It might be nice to switch these over to a panic effect with a severe-compiler-bug-found panic handler.
Some of these use panic, others call to the fuzion.std.panic intrinsic. I tried to switch the latter over to use panic a while ago, but @fridis did not want like this because that meant any calls to these features showed up as using the panic effect with fz -effects. It might be nice to switch these over to a panic effect with a severe-compiler-bug-found panic handler. Then we could have a message like:
error 1: option.val called on nil
[stack trace]
You either turned off safety or you discovered a severe compiler bug!
This code should be unreachable.
(could even switch the message to show "turned off safety" only when !safety).
Originally posted by @maxteufel in https://github.com/tokiwa-software/fuzion/pull/3564#pullrequestreview-2246990282
With anything as simple as setting an option -safety=off, I would prefer not to create a message stating that there is a compiler bug. This is just asking for trouble.
Showing panic when using -effects is not nice (and happens currently anyways due to panic being used in
$MODULE/effect.fz:143:5:
instate R e code (panic "unexpected abort in {effect.this.type}")
for a mutate effect where this panic should be unreachable. We have to do both, improve the DFA to not show panic in dead code and use fuzion.std.panic where this is not possible.