#2866: panic with GADTs + NoMonomorphismRestriction
-------------------+--------------------------------------------------------
Reporter: ganesh | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.10.1 | Severity: normal
Keywords: | Testcase:
Os: Linux | Architecture: x86
-------------------+--------------------------------------------------------
The program below causes
{{{
[EMAIL PROTECTED]:~/temp$ ghc -c Test.hs
ghc: panic! (the 'impossible' happened)
(GHC version 6.10.1 for i386-unknown-linux):
initC: srt_lbl
}}}
with ghc, and
{{{
*Test> E 5
ghc: panic! (the 'impossible' happened)
(GHC version 6.10.1 for i386-unknown-linux):
nameModule xs{v afT}
}}}
with ghci
The problem goes away with ghc -O.
{{{
{-# LANGUAGE GADTs, NoMonomorphismRestriction #-}
module Test where
data Expr a = E Int
deriving Show
data IsSeq a where
IsSeq :: IsSeq [a]
isSeq :: Expr a -> IsSeq a
isSeq = undefined
mkSeq :: [Expr [a]] -> Expr [a]
mkSeq = undefined
unSeq :: Expr [a] -> [Expr [a]]
unSeq = undefined
sequenceEquality :: Expr a -> Expr a
sequenceEquality x = case isSeq x of
IsSeq -> let xs = unSeq x in mkSeq xs
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2866>
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