[erlang-questions] A (probable) dialyzer misconception?

Magnus Henoch <>
Wed Nov 16 10:53:54 CET 2011


> Actually it warns me that the dictionary is a subtype
> of maybe_improper_list. Well, thats very true and correct I
> believe in this case, the has_key function takes a list in a
> specific format. Thats why the spec defines it in that way. That
> being the case, why is dialyzer warning me about this problem?

Because you use the "overspecs" option - that makes Dialyzer warn
about anything that is too tightly specified.  Such situations are
usually not very interesting, and thus the manual recommends not
using "overspecs" and "specdiffs".

(The warning is quite interesting from a theoretical point of view:
it shows that you can pass an improper list as a dictionary to
your functions, and it will work as long as the key is in the
"proper" part of the list.)

Regards,
-- 
Magnus Henoch
Erlang Solutions Ltd
http://www.erlang-solutions.com/




More information about the erlang-questions mailing list