Skip to content

Comments of curly bracket form, which appear at the end of type deffinitions confuse GHC

$ cat HaskarrowHelloWorld.broken.hs
main :: IO (){-# LINE 8 "" #-}
main = print "Hi"
[timothy@timothy rewrite]$ ghc HaskarrowHelloWorld.broken.hs 
[1 of 1] Compiling Main             ( HaskarrowHelloWorld.broken.hs, HaskarrowHelloWorld.broken.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.2 for x86_64-unknown-linux):
	Prelude.head: empty list

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

[timothy@timothy rewrite]$ 
$ ghc HaskarrowHelloWorld.working.hs 
[1 of 1] Compiling Main             ( HaskarrowHelloWorld.working.hs, HaskarrowHelloWorld.working.o )
Linking HaskarrowHelloWorld.working ...
[timothy@timothy rewrite]$ cat HaskarrowHelloWorld.working.hs
main :: IO ()--{-# LINE 8 "" #-}
main = print "Hi"
[timothy@timothy rewrite]$ ./HaskarrowHelloWorld.working 
"Hi"
Trac metadata
Trac field Value
Version 7.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