[Issue 13775] [REG2.067a] Broken explicit casting of dynamic array slices of known size to static array of different type
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Dec 5 08:39:00 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13775
--- Comment #12 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Kenji Hara from comment #11)
> (In reply to Steven Schveighoffer from comment #10)
> > OK, I understand. Is there a reason not to make this assert though?
>
> To do it, we need to handle all invalid casts in front end layer.
I get that, and I get that the fact that it is seen in the glue layer is an
internal error.
But on the surface, it just seems that the compiler is just rejecting (in some
cases correctly) a cast. The confusing part is that the error message is
telling you mainly that the cast is not correct, whether wrong or right -- the
'e2ir' message looks out of place.
In previous bug reports, things like cast(int)"" printed this message. The bug
report was not to say that one expected this cast to work, but that "it looks
like a stray 'e2ir' message is in there." But now, we know that the 'e2ir' is a
clue that the internal error exists. The end result of "fixing" it is that it's
now handled in the front end, but to the user, it just looks like 'e2ir' is
removed (the error message is identical otherwise).
> > The impression it gives is confusing to many people, including myself and Denis.
>
> A possible quick hack is removing "e2ir" from the glue-layer errors.
I don't want this, because then it doesn't get reported and fixed for cast
rejections that *should* be rejected, but aren't handled in the right layer. It
just looks like a normal error and goes unreported.
What I wanted is for the error to say "ICE, please fix me," instead of giving
the impression it's simply a normal error.
In other words the 'e2ir' looks more like a typo than a real error message.
Just make it a proper ICE, and you will get proper reports.
--
More information about the Digitalmars-d-bugs
mailing list