Skip to content

GADT + impredicative polymorphism => stack overflow

The following makes the GHC 6.6 type checker loop/overflow:

{-# OPTIONS_GHC -fglasgow-exts #-}
data Foo a b where F :: a -> Foo () a

bar :: Foo () (forall a.a) -> ()
bar (F _) = ()

ghc yields stack overflow, as does ghci. Reloading in GHCi leads to an infinite loop.

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