Skip to content

infix assert panics ghc

I was repeatedly getting this:

ghc-6.8.3: panic! (the 'impossible' happened)
  (GHC version 6.8.3 for i386-unknown-linux):
        rename/RnExpr.lhs:(139,26)-(150,42): Non-exhaustive patterns in lambda

After some narrowing down, I eventually found the culprit and got a repeatable error with this minimal snippet:

import Control.Exception (assert)
foo = True `assert` ()

The infixness is crucial; assert True () compiles without difficulty. I use infix notation elsewhere, so it appears to be something special about assert.

I was able to compile successfully if I used -O2. I see now that was likely because the asserts are simply eliminated early.

I compiled ghc from sources, so it's barely possible I did something wrong there, but the nature of the symptoms make this doubtful.

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