Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#1173 closed bug (duplicate)

Impredicative type-class context causes stack overflow or non-termination in type checker

Reported by: ccshan Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.6
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

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.
>

Change History (3)

comment:1 Changed 8 years ago by ccshan

  • Resolution set to duplicate
  • Status changed from new to closed

comment:2 Changed 7 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:3 Changed 7 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.