As described in issue 7514 and issue 13775, there is a "minor ICE" whatever that means in e2ir, which prints the message "e2ir" but does not actually abort compilation via assert, which would print a proper message with internal line number.
This is a separate issue from 7514 and 13775, because this is solely concerning the issue of how the error is handled.
Note, this is an ICE according to https://issues.dlang.org/show_bug.cgi?id=3537#c3
Not making it assert(0) just invites incorrect reports or incorrect tagging, as both myself and Denis have done.
It's fine to print the error message of how it occurred, but the result should still be an assert.
Comment #1 by yebblies — 2014-12-31T07:28:59Z
> "minor ICE" whatever that means
It means that it should never happen, and it's a bug in the compiler, but the error is correct and gives the correct message/location info. If coming from e2ir, it means the error wasn't detected during semantic analysis and instead got detected during codegen, which causes problems for the non-dmd backends and the interpreter as they will have to re-implement the missing check.
Comment #2 by schveiguy — 2014-12-31T10:27:47Z
OK, but do you agree with the assessment?
I think at the very least the error message should say ICE. Right now, it looks exactly the same as the error should look, with the addition of e2ir.
Comment #3 by yebblies — 2014-12-31T14:29:16Z
(In reply to Steven Schveighoffer from comment #2)
> OK, but do you agree with the assessment?
>
> I think at the very least the error message should say ICE. Right now, it
> looks exactly the same as the error should look, with the addition of e2ir.
Sure, if you can be bothered. The important thing is that an assert is added, not just the error replaced with assert, because the error contains a lot more information, and they'll probably keep popping up for a while.
Comment #4 by schveiguy — 2014-12-31T15:41:27Z
Most definitely. What happens now is:
1. Error: e2ir: cannot convert ...
2. Person says, "Oh, OK" fixes code.
3. person *maybe* files a bug report about a "stray e2ir" message.
The error printout would have to be done before the assert, right now, it returns an error.
Comment #5 by schveiguy — 2015-01-09T19:06:39Z
Another case that probably would have slipped through if I hadn't known this :)
forum.dlang.org/post/[email protected]
Comment #6 by razvan.nitu1305 — 2022-12-16T14:19:23Z
I cannot reproduce this. I tried the example in: forum.dlang.org/post/[email protected] but I get a nice frontend error: Error: cannot cast expression `s` of type `S` to `void*`.
It seems that the error message was modified to not contain e2ir.