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

Weird -Woverlapping-patterns warnings #136

Closed
quasicomputational opened this issue Oct 5, 2018 · 2 comments
Closed

Weird -Woverlapping-patterns warnings #136

quasicomputational opened this issue Oct 5, 2018 · 2 comments

Comments

@quasicomputational
Copy link
Collaborator

quasicomputational commented Oct 5, 2018

I'm seeing warnings like these while building with GHC 8.4 and 8.6 both:

lib/DhallToCabal.hs:656:9: warning: [-Woverlapping-patterns]
    Pattern match is redundant
    In a case alternative: Expr.App "withinVersion" components -> ...
    |
656 |         Expr.App "withinVersion" components ->
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

lib/DhallToCabal.hs:659:9: warning: [-Woverlapping-patterns]
    Pattern match is redundant
    In a case alternative:
        Expr.App "majorBoundVersion" components -> ...
    |
659 |         Expr.App "majorBoundVersion" components ->
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

lib/DhallToCabal.hs:776:9: warning: [-Woverlapping-patterns]
    Pattern match is redundant
    In a case alternative: Expr.App (Expr.App "or" a) b -> ...
    |
776 |         Expr.App ( Expr.App "or" a ) b ->
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

Experimentally, I tried removing one of the complained-about cases, but that broke the tests, as I'd expected from looking at the code. GHC's pattern coverage checker is evidently drawing a false conclusion, but I'm not sure if it's somehow being led astray or if it's a legitimate compiler bug.

I can't find an obviously responsible ticket in GHC's trac that'd be causing this behaviour. Does anyone have a clue? If not, the next step is to try to minimise the example and verify that it's a GHC bug.

Also, I should note that I think they started with 8801086: I haven't bisected, but that's what git blame points to. I can't see anything obviously amiss about the commit, though.

@quasicomputational
Copy link
Collaborator Author

This is probably a GHC bug and so there's nothing for us to do. Reported it as https://ghc.haskell.org/trac/ghc/ticket/15713.

@ocharles
Copy link
Member

ocharles commented Oct 6, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants