Bug 11485 – [e2ir] Error in e2ir at numeric/bool to class/interface cast
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-09T10:38:00Z
Last change time
2013-11-23T07:03:41Z
Keywords
accepts-invalid, ice, pull
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2013-11-09T10:38:47Z
---
void main()
{
int i;
auto o = cast(Object) i;
}
---
main.d(4): Error: e2ir: cannot cast i of type int to type object.Object
---
Comment #1 by maxim — 2013-11-09T11:51:25Z
First of all, the issue is likely to be resolved-invalid because idea of conversion (even explicit) from int to class is bogus: such cast cannot produce any meaningfull value. In D there is no boxing like in C#.
Secondly, this is not an ICE. ICE is a compiler crash and internal error message in a sence of failed assertions. Rejects-valid is a more appropriate tag.
Comment #2 by verylonglogin.reg — 2013-11-09T12:55:47Z
Sorry for insufficient description.
The issue is only about the ICE. And e2ir errors are ICEs.