Skip to content

indenting change causes internal error

I found a bizarre little bug in GHC 6.12.1 on Mac OS X 10.6 (Haskell Platform 2010.1.0.0 i386). It only occurs when compiling through Cabal; it does not occur when using ghc --make or ghci.

The following code will compile without error but will generate a runtime error:

test = do
       E.throw Failure
       (return "No exception" :: IO String)
     `E.catches`
      [E.Handler (\Failure -> return "Exception")]

The following code will compile and run correctly:

test = do
      E.throw Failure
       (return "No exception" :: IO String)
     `E.catches`
      [E.Handler (\Failure -> return "Exception")]

The only difference between the 2 is that the second has one less leading space.

The generated error is:

test1: internal error: PAP object entered!
    (GHC version 6.12.1 for i386_apple_darwin)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Abort trap

Deleting my ~/.ghc folder had no effect.

Trac metadata
Trac field Value
Version 6.12.1
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