Skip to content

ghc panics on accessing a labeled field

GHC panics about a following code:

class Bar a where
	bar :: Foo a -> Foo a
	bar x = x { foo = [] }
	
data Foo a = Bar a => Foo { foo :: [a] }

GHC says:

Chasing modules from: Main.hs Compiling Main ( Main.hs, Main.o ) ghc: panic! (the `impossible' happened, GHC version 6.4.2): types/Type.lhs:(1107,0)-(1108,77): Non-exhaustive patterns in function zip_ty_env

Trac metadata
Trac field Value
Version 6.4.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information