I have code somewhat similar to the following in a function:
MyApp.Presence.list("somechannel") == []
This causes dialyzer to consider the function to have no_local_return on this function as well as all the functions that call this function. Is there some way to handle that so that it doesn’t propagate all the way up the stack?
I realized that I missed the core dialyzer error:
The call:
MyApp.Presence.list(
_socket :: %Phoenix.Socket{
:assigns => _,
:channel_pid => pid(),
:topic => binary(),
_ => _
}
)
will never return since it differs in arguments with
positions 1 from the success typing arguments:
(%Phoenix.Socket{
:topic => %Phoenix.Socket{:topic => %Phoenix.Socket{:topic => map(), _ => _}, _ => _},
_ => _
})
But MyApp.Presence.list/1 seems to work fine when passed a binary/string instead of a socket so I’m not sure what the next step would be. Does this indicate a bug in Phoenix?