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
Warning 8 suppresses warning 25 #7059
Comments
Comment author: @johnwhitington This appears to have already been discussed in 6438, and set to won't_fix. Sorry for the noise. Perhaps update the message as lpw25 suggests in 6438. |
Comment author: @garrigue Well, maybe we should have done something for 6438.
I would rather vote for suppressing warning 25, and have it raise warning 8 instead, with the following message: Warning 8: this pattern-matching is not exhaustive. |
Comment author: @alainfrisch
I'm in favor of this change. |
Comment author: @alainfrisch Git PR: #315 |
Comment author: @johnwhitington I like this solution. |
Comment author: @alainfrisch #315 merged for 4.03. |
Comment author: @gasche I consider this issue only partially solved as the current state does not print an exhaustivity counter-example in this case. Would it be ok if I re-opened the bug for tracking purposes? (Eg. "suspended".) |
Original bug ID: 7059
Reporter: @johnwhitington
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-02-16T14:18:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #6438
Monitored by: @gasche @hcarty
Bug description
match 1 with 1 when x = y -> 1;;
Warning 25: bad style, all clauses in this pattern-matching are guarded.
match 1 with 1 -> 1;;
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
0
Shouldn't warning 8 be triggered in the first case in addition to warning 25 -- it's more important, isn't it?
The text was updated successfully, but these errors were encountered: