-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix false nonexhaustive record patterns warning #419
Fix false nonexhaustive record patterns warning #419
Conversation
b3c62a9
to
3a9b218
Compare
3a9b218
to
5359c86
Compare
Some comments need fixing, so I'm converting this to a draft for now. |
Neat, this seems better than #411 I will try the PR in the upcoming days 👍 edit: see #414 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK, but the one below worked before and now it's move to known problems (should fail). Do you think it is less important than the added test case? Can you think of a way to solve both?
-type t() :: ala | ola.
-spec f(t(), any()) -> ok.
f(ala, _) -> ok.
Yes, I think it's less important. We get rid of a very annoying and very common false positive warning that way.
I don't know how to do that and I'm unsure if it's possible at all without really significant changes to the typechecker. The long explanation is in #418, together with some approaches I tried, but to no success :/ |
…e to have it back at some point
See josefs#418 for the rationale.
5359c86
to
74a98cc
Compare
Then I think we can document that we do exhaustiveness if and only if all of the parameters are typed, not any(). Does it make sense? It's good to have a clear rule to follow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, feel free to merge when ready.
The edoc comments are mainly for internal use. The user documentation (as far as we have any) is on the wiki so we can consider updating that too.
This stems from the research in #418 and supersedes any experiments done there. By dropping argument-wise exhaustiveness checking we get rid of the false positive warning and therefore go from:
to