Skip to content
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

Non-exhaustive matching warning message for open types is confusing #6466

Closed
vicuna opened this issue Jun 19, 2014 · 7 comments
Closed

Non-exhaustive matching warning message for open types is confusing #6466

vicuna opened this issue Jun 19, 2014 · 7 comments
Assignees
Labels
Milestone

Comments

@vicuna
Copy link

@vicuna vicuna commented Jun 19, 2014

Original bug ID: 6466
Reporter: @whitequark
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:37:16Z)
Resolution: fixed
Priority: normal
Severity: text
Version: 4.02.0+beta1 / +rc1
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.1+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche @hcarty

Bug description

Here it is:

Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
*extension*

I scratched my head for quite a while before I got it.

Steps to reproduce

function Not_found -> ()

File attachments

@vicuna
Copy link
Author

@vicuna vicuna commented Jul 16, 2014

Comment author: @damiendoligez

Let's have a discussion of what the error message should look like.

@vicuna
Copy link
Author

@vicuna vicuna commented Sep 14, 2014

Comment author: @whitequark

Warning 8: this pattern-matching is not exhaustive.
Matching over values of open types must include
a wildcard pattern in order to be exhaustive.

@vicuna
Copy link
Author

@vicuna vicuna commented Sep 15, 2014

Comment author: @garrigue

Fixed as suggested.
The warning is now:

Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
_
Matching over values of open types must include
a wild card pattern in order to be exhaustive.

Removing the 2nd and 3rd line would require changing the warning definition.

@vicuna
Copy link
Author

@vicuna vicuna commented Sep 15, 2014

Comment author: @lpw25

For consistency with the documentation, could we change:

Matching over values of open types must include
a wild card pattern in order to be exhaustive.

to

Matching over values of extensible variant types must include
a wild card pattern in order to be exhaustive.

@vicuna
Copy link
Author

@vicuna vicuna commented Oct 15, 2014

Comment author: @damiendoligez

Reopened: let us discuss (or implement) Leo's proposed change to the warning message.

@vicuna
Copy link
Author

@vicuna vicuna commented Dec 19, 2014

Comment author: @whitequark

gasche, can you please apply the trivial fix listed in the issue?

@vicuna
Copy link
Author

@vicuna vicuna commented Dec 21, 2014

Comment author: @gasche

Merged in trunk and 4.02.

@vicuna vicuna closed this as completed Dec 7, 2016
@vicuna vicuna added this to the 4.02.2 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants