You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3424 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Gilles Dubochet
Version: 3.08.2
OS: Mac OS X
Submission from: dhcp-11-126.inf.ed.ac.uk (129.215.11.126)
When this following expression is compiled:
"let f : ([A]->int) = function A -> 1 | `B -> 2"
The following warning is printed:
"Warning: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched: AnyExtraTag Warning: this match case is unused. val tata : [ A ] -> int = "
This warning is not correct: the pattern is complete, or rather is more than
complete. The B case cannot be used ("f B" will generate as expected a type
error), and the `AnyExtraTag cannot be used either.
I don't know what the correct behaviour would be: either changing the warning
message, or treat this as an error (this seems to be the more natural way: I
cannot see any situation where such code would be acceptable).
The text was updated successfully, but these errors were encountered:
When this following expression is compiled:
"let f : ([A]->int) = function A -> 1 | `B -> 2"
The following warning is printed:
"Warning: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched: AnyExtraTag Warning: this match case is unused. val tata : [ A ] -> int = "
Indeed, the first warning is wrong, due to a small bug in the way tags were
counted.
Thank you for the report; this will be fixed in 3.08.3.
The second warning is correct, and sufficient here.
Original bug ID: 3424
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Gilles Dubochet
Version: 3.08.2
OS: Mac OS X
Submission from: dhcp-11-126.inf.ed.ac.uk (129.215.11.126)
When this following expression is compiled:
"let f : ([
A]->int) = function
A -> 1 | `B -> 2"The following warning is printed:
"Warning: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
AnyExtraTag Warning: this match case is unused. val tata : [
A ] -> int = "This warning is not correct: the pattern is complete, or rather is more than
complete. The
B case cannot be used ("f
B" will generate as expected a typeerror), and the `AnyExtraTag cannot be used either.
I don't know what the correct behaviour would be: either changing the warning
message, or treat this as an error (this seems to be the more natural way: I
cannot see any situation where such code would be acceptable).
The text was updated successfully, but these errors were encountered: