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

Wrong warning in pattern matching #2633

Closed
vicuna opened this issue Dec 7, 2000 · 2 comments
Closed

Wrong warning in pattern matching #2633

vicuna opened this issue Dec 7, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Dec 7, 2000

Original bug ID: 242
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hello,

It seems that inexhaustive matches with polymorphic variants are not
correctly reported:

The following piece of code

let green = List.hd [ red; `green ] ;;

gives this incorrect warning message:

Warning: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
(green|red)

But this example

type colour = Red | Green ;;
let Green = List.hd [ Red; Green ] ;;

gives a correct warning message:

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

  • Markus Mottl

--
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl

@vicuna
Copy link
Author

vicuna commented Dec 8, 2000

Comment author: administrator

This is already fixed in the CVS (see #2570).

Thank you for the report.

Jacques

@vicuna
Copy link
Author

vicuna commented Dec 8, 2000

Comment author: administrator

see #2570

@vicuna vicuna closed this as completed Dec 8, 2000
@vicuna vicuna added the bug label Mar 19, 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

1 participant