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

Incorrect "Warning: this pattern is unused." #4004

Closed
vicuna opened this issue Apr 16, 2006 · 2 comments
Closed

Incorrect "Warning: this pattern is unused." #4004

vicuna opened this issue Apr 16, 2006 · 2 comments
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Apr 16, 2006

Original bug ID: 4004
Reporter: mattiasw
Assigned to: @maranget
Status: closed (set by @maranget on 2006-09-21T14:37:13Z)
Resolution: fixed
Priority: normal
Severity: text
Version: 3.08.4
Category: ~DO NOT USE (was: OCaml general)

Bug description

I would assume the following two functions are equivalent. However, I get a warning "Warning: this pattern is unused." for the first for the row with (1|2).

let f str =
match str with
| "dec2bin", 1 -> ()
| "dec2bin", (1|2) -> ()
| _ -> ()
;;

let f2 str =
match str with
| "dec2bin", 1 -> ()
| "dec2bin", 2 -> ()
| _ -> ()
;;

@vicuna
Copy link
Author

vicuna commented Apr 16, 2006

Comment author: mattiasw

After looking into this, I think that the only thing that is needed to improve the error message. When I got the message "Warning: this pattern is unused." I though the whole line was ignored. However, this isn't the case, so maybe something like ""Warning: this SUBpattern is unused." would be enough.

@vicuna
Copy link
Author

vicuna commented Sep 21, 2006

Comment author: @maranget

Error message improved, as suggested.

--Luc

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