#2506: infix assert panics ghc
-----------------------+----------------------------------------------------
Reporter: galen | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.8.3 | Severity: normal
Keywords: | Testcase:
Architecture: x86 | Os: Linux
-----------------------+----------------------------------------------------
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.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2506>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs