-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dialyzer should consider the use for an improper list #5937
Comments
Thanks for your report! This warning is not for the use of, but rather the construction of improper lists, which the original authors considered awful. We're leaning towards disabling these warnings by default in a future version, but for now you can pass |
Or suppress it: |
Ok, the warning being about construction of an improper list makes a subtle difference. @dgud Yes! That is what I have been using to make these go away. |
That's just the opinion of the original authors, at least as it were back then. Many of us at OTP disagree with the warning because it throws the baby out with the bathwater, there's nothing wrong with using a single cons cell as a more compact alternative to 2-tuples in internal code like |
Thanks for the additional context. |
Describe the bug
Dialyzer produces an improper list warning even when that list is constructed for a function call that specs an improper list .e.g.
iodata()
Consider
erlang:port_control/3
And this code snippet:
Causes this dialyzer output:
x.erl:10: Cons will produce an improper list since its 2nd argument is <<_:32>>
To Reproduce
Put the example above into a module and dialyze
Expected behaviour
If the success typing for a constructed list is an improper list - and especially
iodata()
- then no warning should be emitted.Affected versions
All?
The text was updated successfully, but these errors were encountered: