Control.Exception.assert broken with -O
|Reported by:||fergus||Owned by:||nobody|
|Type of failure:||Test Case:|
|Related Tickets:||Differential Rev(s):|
According to the ghc documentation (section 4.9 "optimization" and section 7.8 "assertions" in the user guide, and the documentation for Control.Exception in the hierarchical libraries guide), assertions should be checked unless explicitly disabled with "-fignore-asserts", and the "-O" option should have no effect on them. But in ghc version 220.127.116.1150801, "-O" seems to also have the effect of disabling assertions: bash$ cat Test.hs import Control.Exception main = print (assert False (42::Int)) bash$ ghc -O Test.hs && ./a.out 42 This undocumented behaviour is an egregious violation of the principle of least surprise.
Change History (1)
Note: See TracTickets for help on using tickets.