Unnecessarily complicated left-hand side for SPECIALIZE pragma causing RULE left-hand side too complicated to desugar
GHC 7.10.2 rejects the SPECIALIZE
pragma in the following snippet with "RULE left-hand side too complicated to desugar".
class C a where
type TF a; m :: a -> TF a
instance C Int where
type TF Int = String; m = show
overloaded :: C a => a -> (a,TF a)
{-# INLINABLE overloaded #-}
overloaded a = (a,m a)
{-# SPECIALIZE overloaded :: Int -> (Int,TF Int) #-}
This use case is so simple/basic/prevalent that it seems inappropriate to reject it.
The actual message is
RULE left-hand side too complicated to desugar
Optimised lhs: case cobox_awc
of _ [Occ=Dead] { GHC.Types.Eq# cobox ->
overloaded @ Int $dC_awb
}
Orig lhs: case cobox_awc of cobox_awc { GHC.Types.Eq# cobox ->
overloaded @ Int $dC_awb
}
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | #10555 |
Blocking | |
CC | |
Operating system | |
Architecture |