Skip to content

Compiler panic on invalid syntax (unterminated pragma)

The following minimal example causes a compiler panic.

{-# OPTIONS_GHC -O1 }
"
  #-}
ghc-stage2.exe: panic! (the 'impossible' happened)
  (GHC version 8.5.20180413 for x86_64-unknown-mingw32):
        getOptions'.parseToks: Couldn't read "\r\n\"\r\n  " as String

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

Happens in HEAD and 8.2.2 at least. Double quotes seem to confuse the parser. Also panics if there are two doublequotes.

Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
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