
#8710: Overlapping patterns warning misplaced -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: | PatternMatchWarnings Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gkaracha): Replying to [comment:3 thomie]:
I would maybe prefer separate warnings, such that even for a single redundant clause, the warning message doesn't have to mention two different line numbers (one for the location of the whole match, and one for the location of the redundant clause).
I don't know if there is precedent for multiple line numbers in a warning message.
Either way is fine though.
I created a small patch for this (Phab:D1910). If we print a separate warning for every redundant clause it may become overwhelming so I thought that it would be best to keep them all in the same warning. The patch has the following behavior: {{{ Bug.hs:22:3: warning: Pattern match(es) are overlapped In an equation for ‘show’: len _ = ... (at Bug.hs:24:3) len _ = ... (at Bug.hs:25:3) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8710#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler