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?
to your account
Original bug ID: 6801
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:14:44Z)
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Duplicate of: #6403
Related to: #6437
Child of: #5998
Monitored by: @gasche @yallop @hcarty
Exhaustiveness messages for GADTs are a bit off. They will suggest patterns need to be inserted for constructors that are not actually legal to insert because they will not type check.
A simple example:
type _ value =
| String : string -> string value
| Float : float -> float value
let print_string_value (x : string value) =
match x with
| String s -> print_endline s
The resulting message:
File "test.ml", line 7, characters 2-46:
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
But of course, inserting a pattern for Float _ won't go very well!
The text was updated successfully, but these errors were encountered:
Comment author: @garrigue
See #6437 for a patch which solves this problem.
Sorry, something went wrong.
Branch gadt-warnings was merged in trunk at revision 16532.
No branches or pull requests