-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Elixir and Erlang/OTP versions
1.18.4 and v1.19 branches, OTP28
Operating system
Current behavior
@base_uri URI.new!("https://example.com")
def foo_uri do
@base_uri |> URI.append_path("/foo")
end
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>>
)
Expected behavior
No warning.
This is exactly like #14576 all over again, but for module attributes rather than inline calls 😭
We could:
- mark as generated after escaping (again, reducing the usefulness of the type system :/)
- remove opaqueness as previously suggested - this should eventually be checked via the new type system anyway?
- do nothing and require people to locally silent warning in such cases
- disable dialyzer opaqueness checks as previously mentioned - not sure at which level though?
Originally reported here
Metadata
Metadata
Assignees
Labels
No labels