[GHC] #13766: Confusing "redundant pattern match" in 8.0, no warning at all in 8.2
GHC
ghc-devs at haskell.org
Mon May 29 19:48:27 UTC 2017
#13766: Confusing "redundant pattern match" in 8.0, no warning at all in 8.2
-------------------------------------+-------------------------------------
Reporter: edsko | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by mpickering):
This is the expected behaviour, the commit message explains the reasoning.
{{{
Previously when the checker encountered an unsatisfiable term of type
context it would return an empty initial uncovered set. This caused all
pattern matches in the context to be reported as redudant.
This is arguably correct behaviour as they will never be reached but it
is better to recover and provide accurate warnings for these cases to
avoid error cascades. It would perhaps be better to report an error to
the user about an inacessible branch but this is certainly better than
many confusing redundant match warnings.
}}}
Warning that the RHS is inaccessible would be valuable but I don't think
it's the domain of the pattern match checker to warn indirectly of this by
warning of "redundant" clauses. So it looks like the tickets that Edward
linked are more relevant.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13766#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list