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

When duplicate patterns exist an unhelpful warning is given #1853

Closed
dkoontz opened this issue Jan 25, 2016 · 2 comments
Closed

When duplicate patterns exist an unhelpful warning is given #1853

dkoontz opened this issue Jan 25, 2016 · 2 comments

Comments

@dkoontz
Copy link

dkoontz commented Jan 25, 2016

Given the following code

module Main where

data Options = Foo | Bar | Baz

brokenPatternMatch :: Options -> Boolean
brokenPatternMatch Foo = true
brokenPatternMatch Foo = true
brokenPatternMatch Bar = false
brokenPatternMatch Baz = false

produces the warning A case expression contains unreachable cases: Baz which is probably technically true but not very helpful. "duplicate pattern Foo" would seem better.

@paf31
Copy link
Contributor

paf31 commented Jan 25, 2016

No, that'd be a bug. Baz is not unreachable. The error should be that Foo is unreachable.

cc @nicodelpiano, any thoughts on this?

@paf31 paf31 added this to the 0.9.0 milestone Jan 25, 2016
@paf31 paf31 added the linter label Jan 25, 2016
@nicodelpiano
Copy link
Contributor

Yes, it seems to be the redundancy checker. Let me check that out.
El ene. 25, 2016 3:03 PM, "Phil Freeman" notifications@github.com
escribió:

No, that'd be a bug. Baz is not unreachable. The error should be that Foo
is unreachable.

cc @nicodelpiano https://github.com/nicodelpiano, any thoughts on this?


Reply to this email directly or view it on GitHub
#1853 (comment)
.

nicodelpiano added a commit to nicodelpiano/purescript that referenced this issue Jan 26, 2016
@paf31 paf31 closed this as completed Feb 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants