#1174: Impredicative type-class context causes stack overflow or non-termination
in type checker
-------------------------+--------------------------------------------------
    Reporter:  ccshan    |       Owner:         
        Type:  bug       |      Status:  new    
    Priority:  normal    |   Milestone:         
   Component:  Compiler  |     Version:  6.6    
    Severity:  normal    |    Keywords:         
  Difficulty:  Unknown   |    Testcase:         
Architecture:  Unknown   |          Os:  Unknown
-------------------------+--------------------------------------------------
This program makes GHC loop.  The first time the stack overflows; the
 second time GHCi just hangs.

 {{{
 $ cat Bug.hs
 {-# OPTIONS -fglasgow-exts #-}

 module Bug where

 data T t where
     T :: (forall a. T (f a)) -> T (forall a. f a)

 instance Show (T t) where
     show (T t) = show t

 $ ghci Bug.hs
    ___         ___ _
   / _ \ /\  /\/ __(_)
  / /_\// /_/ / /  | |      GHC Interactive, version 6.6, for Haskell 98.
 / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
 \____/\/ /_/\____/|_|      Type :? for help.

 Loading package base ... linking ... done.
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )
 *** Exception: stack overflow
 > :reload
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )
 Interrupted.
 >
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1174>
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

Reply via email to