[ ghc-Bugs-992200 ] Template crash on constructing existential data
type
SourceForge.net
noreply at sourceforge.net
Fri Jul 16 05:11:20 EDT 2004
Bugs item #992200, was opened at 2004-07-16 09:11
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=992200&group_id=8032
Category: Compiler
Group: 6.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Mike Aizatsky (mm_aa)
Assigned to: Nobody/Anonymous (nobody)
Summary: Template crash on constructing existential data type
Initial Comment:
Windows XP
D:\Tools\ghc>ghc-6.2.1\bin\ghc.exe -fglasgow-exts --make foo.hs
Chasing modules from: foo.hs
Compiling Any ( ./Any.hs, ./Any.o )
Compiling Foo ( foo.hs, foo.o )
Loading package base ... linking ... done.
Loading package haskell98 ... linking ... done.
Loading package haskell-src ... linking ... done.
ghc.exe: panic! (the `impossible' happened, GHC version 6.2.1):
Malformed predicate
module Any where
import Language.Haskell.THSyntax
genAny :: DecQ -> Q [Dec]
genAny decl =
do{
d <- decl
; case d of
ClassD _ name _ decls -> sequenceQ [genAnyClass
(name)
decls]
_ -> error "genAny can be applied to classes only"
}
genAnyClass :: String -> [Dec] -> DecQ
genAnyClass name decls =
do{
returnQ (DataD [forall] anyName [] [constructor] [])
}
where
anyName = "Any" ++ name ++ "1111"
constructor = NormalC anyName [(NotStrict, VarT "a")]
forall = ForallT [] [] (VarT "a")
module Foo where
import Any
class MyInterface a where
foo :: a -> Int
foo1 :: Int -> a -> Int
$(genAny (reifyDecl MyInterface))
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=992200&group_id=8032
More information about the Glasgow-haskell-bugs
mailing list