Closed Mathnerd314 closed 3 years ago
Thanks! Seems a very sensible function to include. The NOINLINE on error is because otherwise the rules of IO exceptions might mean that the error moves location, and thus fires when people don't expect it. Leaving it out for assert, given the special assertion handling, makes a lot of sense.
This is a function similar to
errorIO
that allows using assertions as actions:It seems to optimize away like the original
assert
, at least for the simple program above. I'm not sure whyerrorIO
has aNOINLINE
but I left it out here because it would remove the optimization property.