[GHC] #8710: Overlapping patterns warning misplaced

GHC ghc-devs at haskell.org
Sun Jan 10 15:32:53 UTC 2016


#8710: Overlapping patterns warning misplaced
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:
       Component:  Compiler          |              Version:  7.7
      Resolution:                    |             Keywords:
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:1 thomie]:
 > George, how hard would it be to do this?

 Not very if we agree how we want the messages to look like. At the moment
 function `dsPmWarn`
 in `deSugar/Check.hs` takes the location **of the whole match**, so that
 it can say that "the
 following clauses of this match are redundant..". Every clause is an
 `LMatch` so we have location
 information available if we want to use this instead of the location of
 the match. My question is,
 do we want a separate warning for every redundant clause, or we want the 1
 warning/match (what we
 currently have), just with more information in it? E.g. something like the
 following:
 {{{
 Bug.hs:22:3: Warning:
     Pattern match(es) are overlapped
     In an equation for ‘show’:
         Bug.hs:24:3: len _     = ...
         Bug.hs:25:3: len _     = ...
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8710#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list