[erlang-questions] A (probable) dialyzer misconception?
Wed Nov 16 16:11:28 CET 2011
On 11/16/11 at 09:53am, Magnus Henoch wrote:
> > 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".
Thanks, Magnus. I thought this might be a RTFM problem and I just
wasn't picking it up while reading the manual. This makes perfect
> (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.)
Very interesting from a theoretical sense. Much less so from a
dialyzer newbe WTF sense ;)
More information about the erlang-questions