panic at applyTypeToArgs
Robert Ennals
Robert.Ennals@cl.cam.ac.uk
Thu, 08 Nov 2001 19:02:54 +0000
Just came across an interesting little bug.
The compiler is essentially HEAD (last cvs updated yesterday - no obvious
recent commits that would affect this).
The panic goes away if I do one of the following:
change "Double" to "Int"
change "Double" to "[Double"]
remove "deriving Show"
compile without optimisation
Hoping that this isn't just me doing something stupid when updating my source
tree...
Here comes a log:
bash$ cat Bug.hs
module Bug
where
data Bla = Blob Double
deriving Show
bash$ ghc --make -O Bug.hs
ghc-5.03: chasing modules from: Bug.hs
Compiling Bug ( Bug.hs, ./Bug.o )
ghc-5.03: panic! (the `impossible' happened, GHC version 5.03):
applyTypeToArgs
PrelFloat.zdwshowsPrec1{-roY-}
lvl_s1ae
w_a19o
ww_a19q
(let {
lvl46{-s1a7-} L :: [PrelBase.Char{-3o-}]
Arity 0 Just DmdType
lvl46{-s1a7-} =
PrelBase.zdwZC{-65-}
@ PrelBase.Char{-3o-} PrelShow.lvl37{-rhQ-} s{-rvo-} } in
__letrec {
showl{-s1a9-} _Kx L :: ([Bug.Bla{-r4-}] -> [PrelBase.Char{-3o-}])
Arity 1 Just DmdType V
showl{-s1a9-}
= \ ds2{-rvx-} V :: [Bug.Bla{-r4-}] ->
case ds2{-rvx-} of wild1{-rvt-} A {
PrelBase.ZC{-64-} y{-rvw-} U*(S*(L)) ys{-rvv-} L ->
let {
a_s1al L :: PrelBase.String{-r8R-}
Arity 0 Just DmdType {rvw->U(S*(L))}
a_s1al
= case y{-rvw-} of wild_XQ A { Bug.Blob{-r3-}
b1{-X12K-} S*(L) ->
PrelBase.append{-r8U-}
@ PrelBase.Char{-3o-}
zz_s1a0
(case b1{-X12K-} of w_X1ad L { PrelFloat.Dzh{-66-}
ww_X1ah L ->
PrelFloat.zdwshowsPrec1{-roY-}
lvl_s1ae w_X1ad ww_X1ah (showl{-s1a9-} ys{-rvv-})
})
}
} in
PrelBase.zdwZC{-65-}
@ PrelBase.Char{-3o-} PrelShow.lvl13{-ri0-} a_s1al;
PrelBase.ZMZN{-6m-} -> lvl46{-s1a7-}
};
} in showl{-s1a9-} xs{-rvq-})
Please report it as a compiler bug to glasgow-haskell-bugs@haskell.org,
or http://sourceforge.net/projects/ghc/.
bash$ ghc --make Bug.hs
ghc-5.03: chasing modules from: Bug.hs
Compiling Bug ( Bug.hs, ./Bug.o )
bash$
-Rob