#5718: Misplaced SPECIALIZE instance pragma silently ignored
------------------------------+---------------------------------------------
Reporter: asr | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.2.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
------------------------------+---------------------------------------------
The user's guide for GHC 7.2.2 says that a SPECIALIZE instance pragma must
occur inside the ''where'' part of the instance declaration
(http://www.haskell.org/ghc/docs/7.2.2/html/users_guide/pragmas.html
#specialize-instance-pragma), but it is not checked by GHC 7.2.2 (GHC
7.4.1 RC1 (7.4.0.20111219) correctly yields an error in this situation).
For example, the following code is accepted
{{{
data Foo a = MkFoo a
{-# SPECIALIZE instance Eq (Foo Int) #-}
instance (Eq a) => Eq (Foo a) where
MkFoo a1 == MkFoo a2 = a1 == a2
}}}
I don't understand the core code, but using the flags -ddump-simpl-stats
and -dppr-debug I see a different output with/without a misplaced
SPECIALIZE instance pragma, so I guess the pragma is being silently
ignored. Can anyone confirm this please?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5718>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs