I am running Dialyzer with '-Woverspecs' and receive this warning:
room_channel.ex:143:
Type specification 'Elixir.Backend.RoomChannel':
testU(a) -> a when is_subtype(a,#{})
is a subtype of the success typing: 'Elixir.Backend.RoomChannel':testU(_) -> any()
with this code:
@spec testU( a ) :: a when a: %Backend.User{}
def testU(u) do
...
what I would love to do is nail down the function type with a guard so that the subtyping warning goes away and I have a precise definition of my function.
I see in the Erlang docs that -Woverspecs is not encouraged and suspect I am cutting against the grain, as the only solution I can think of is some complicated function guard...
Any ideas or pointers?