Skip to content

UndecidableInstances not needed for equality constraints

Consider

instance (Op c, In c ~ Int) => Op (D2 c) where ...

Without -XUndecidableInstaces we get

undec.hs:21:0:
     Constraint is no smaller than the instance head
       in the constraint: In c ~ Int
     (Use -XUndecidableInstances to permit this)

But the undecidable-instance check is only needed for class constraints I think, so GHC is being over conservative. Let's fix this.

Trac metadata
Trac field Value
Version 6.12.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information