[erlang-questions] dialyzer is driving me nuts

Joel Reymont joelr1@REDACTED
Tue Oct 18 20:07:42 CEST 2011

On Oct 18, 2011, at 7:02 PM, Fred Hebert wrote:

> I think for that one the problem is that it infers it can find 'skip' but your type doesn't have it in there. You won't easily be able to add that clause without overloading contracts though.

How should this be fixed then?

The message I get is that overloaded contracts are not supported.

The problem of the catch-all clause in gen_servers, etc. is a generic one. 

How is it to be typed to please Dialyzer?

> I believe this means you'd be breaking the contract of gamelib:join/2 if it doesn't accept #game{} as a tuple in its own type spec, or that the #game{} it accepts doesn't have similar opaque terms inside of it. I haven't tried to fix it and see though.

This is gamelib:join, it does accept #game{} in its own type spec and otherwise.

-spec join(#game{}, #pm_event{pm_message :: #pm_join{}}, seat_state()) -> #game{}.

join(Game = #game{}, #pm_event{ player = Player, wsop_id = WSOPID, pm_message = #pm_join{} = R }, State) ->

- for hire: mac osx device driver ninja, kernel extensions and usb drivers
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont

More information about the erlang-questions mailing list