Open nh2 opened 5 months ago
I'm all for assertions, but people usually don't like the idea. We should at least enable them in CI. And fix whichever are failing...
but people usually don't like the idea
People don't want assertions in production code that make it 100x slower.
The checks implemented in that file seem to be simple integer comparisons, fast enough to enable without noticing anything.
So I think those should just be error
.
I'm building
ghc-events
as part of static-haskell-nix's CI, where sometimes I build with-O0
.An assertion appears:
That's this one:
https://github.com/haskell/ghc-events/blob/2168f610bf3580a3a4dca7b0582c6384d5433413/src/GHC/RTS/Events/Binary.hs#L822-L830
I tested also with
stack test
on astack.yaml
with this config:As documented in assert, it's disabled on
-O
, whichcabal
enables by default.So probably nobody noticed that.
I recommend setting either
if assertions should be used in code, or not using
assert
.