[GHC] #13766: Confusing "reudundant pattern match" in 8.0, no warning at all in 8.2

GHC ghc-devs at haskell.org
Mon May 29 08:05:23 UTC 2017


#13766: Confusing "reudundant 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
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I couldn't find an existing ticket about this, so I figured I'd file this
 even though it's probably an instance of a more general problem.
 Consider

 {{{#!hs
 {-# LANGUAGE TypeFamilies #-}
 {-# OPTIONS_GHC -Wall -Woverlapping-patterns #-}

 module T where

 class C a where
   c :: a -> a

 instance Int ~ Bool => C Int where
   c = id
 }}}

 yields

 {{{
 T.hs:10:3: warning: [-Woverlapping-patterns]
     Pattern match is redundant
     In an equation for ā€˜cā€™: c = ...
 }}}

 which I suppose makes _some_ amount of sense but is highly confusing
 nonetheless :)

 Now in 8.2 I don't get this warning, but in fact I don't get any warning
 at all, which I'm not entirely sure is better. In the real code obviously
 the superclass constraint was far more complicated and it was nice of ghc
 to warn me (albeit in a roundabout way) that it was unsatisfiable.

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


More information about the ghc-tickets mailing list