"Function call without opaqueness type mismatch" under OTP 28

With this code under OTP 27 dialyzer ran cleanly:

defmodule Test do
  @base_uribase_uri URI.new!(“`https://google.ca`”)

  def our_base do
    @base_uri |> URI.append_path(“/foo”)
  end
end

But in OTP 28 we are getting the following error:


> mix dialyzer
…

---

lib/app/test.ex:5:call_without_opaque
Function call without opaqueness type mismatch.

Call does not have expected term of type %URI{
:authority => URI.authority(),
:fragment => nil | binary(),
:host => nil | binary(),
:path => nil | binary(),
:port => nil | char(),
:query => nil | binary(),
:scheme => nil | binary(),
:userinfo => nil | binary()
} (with opaque subterms) in the 1st position.

URI.append_path(
%URI{
:authority => nil,
:fragment => nil,
:host => <<103, 111, 111, 103, 108, 101, 46, 99, 97>>,
:path => nil,
:port => 443,
:query => nil,
:scheme => <<104, 116, 116, 112, 115>>,
:userinfo => nil
},
<<47, 102, 111, 111>>
)

1 Like

This looks like something to report to the elixir repo.

I think it should be fixed on the next 1.19rc: Mark inlined function call result as generated by sabiwara · Pull Request #14581 · elixir-lang/elixir · GitHub

2 Likes

OK I tried it out and it seems the error is still present on the v1.19 branch :cry:

Will open an issue.

Edit: issue link: Opaqueness warning on OTP28 · Issue #14750 · elixir-lang/elixir · GitHub

3 Likes

Thank you!