[erlang-questions] dialyzer apparently-erroneously thinking a spec is underspecified

Felix Gallo felixgallo@REDACTED
Thu Dec 10 22:51:35 CET 2015


consider:

https://gist.github.com/anonymous/e5165c443f6bdf0f0780

by inspection, the spec on the boop function is "wrong", but this code
passes dialyzer, unless you run it with -Wunderspecs or -Wspecdiffs, at
which point it complains:

tt.erl:10: The specification for tt:boop/1 states that the function might
also return 'glory' but the inferred return is 'hello' | 'micronauts'

So dialyzer does notice that 'micronauts' might be returned, and does know
that the glory() type does not include that as a choice, but believes that
the spec is just underspecified, rather than violated.  Why is that?

F.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151210/444f6b26/attachment.htm>


More information about the erlang-questions mailing list