Confusing "redundant pattern match" in 8.0, no warning at all in 8.2
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
{-# 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.
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |