Re: Unsettling dialyzer errors
Nicolas Martyanoff <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <[email protected]> |
Josef Svenningsson <[email protected]> writes: > On 2/28/21 11:39 AM, Josef Svenningsson wrote: > No, Gradualizer is not saying that foo/1 should take arguments of type > t1(). It's saying that the program calls f1/1 with a variable of type > t1()|t2() but the declared type of f1/1 only accepts arguments of t1(). > Hence the error. > Gradualizer looks at the declared types of functions and will report an > error if there is an incompatibility, but it doesn't "expect" the types to > be anything. This is the behaviour I expect from a type checker. Too many times, I end up with errors about types that Dialyzer itself inferred, having to find out how they relate to the type specifications I provided. I'll try to run Gradualizer on my main codebase, it should be quite interesting. -- Nicolas Martyanoff http://snowsyn.net [email protected]