We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Original bug ID: 305 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Full_Name: Fermin Reig Version: version 3.00+22 (2001-02-05) OS: alpha linux Submission from: giro.gla.ac.uk (130.209.6.41)
In this or-pattern
let f1 = function Some n -> 0 | None | Some 1 -> 1
"Some 1" is an unused match case. The compiler does not report it. For a similar or-pattern
let f2 = function n -> 0 | 0 | 1 -> 1
"1" is correctly reported as an unused match case.
The text was updated successfully, but these errors were encountered:
Comment author: administrator
Full_Name: Fermin Reig Version: version 3.00+22 (2001-02-05) OS: alpha linux Submission from: giro.gla.ac.uk (130.209.6.41) In this or-pattern let f1 = function Some n -> 0 | None | Some 1 -> 1 "Some 1" is an unused match case. The compiler does not report it. For a similar or-pattern let f2 = function n -> 0 | 0 | 1 -> 1 "1" is correctly reported as an unused match case.
This is rather a plea for a new feature than a plain bug.
In f1, the second clause | None | Some 1 -> 1 is not unsused since its pattern matches ``None''.
The clause is in some sense partially unused, since it can be simplified into ``| None -> 1''
In your second example, the clause is a true unused ine : its pattern never matches.
Flagging ``partially unused clausses'' is a good idea.
--Luc Maranget
Sorry, something went wrong.
Done in 3.05 (Luc Maranget).
No branches or pull requests
Original bug ID: 305
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Fermin Reig
Version: version 3.00+22 (2001-02-05)
OS: alpha linux
Submission from: giro.gla.ac.uk (130.209.6.41)
In this or-pattern
let f1 = function
Some n -> 0
| None | Some 1 -> 1
"Some 1" is an unused match case. The compiler does not report it.
For a similar or-pattern
let f2 = function
n -> 0
| 0 | 1 -> 1
"1" is correctly reported as an unused match case.
The text was updated successfully, but these errors were encountered: