Bug 10646 – No front-end error for invalid casting dynamic array/static array to class reference
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-15T06:31:00Z
Last change time
2015-02-18T03:42:31Z
Keywords
pull
Assigned to
nobody
Creator
henning
Comments
Comment #0 by henning — 2013-07-15T06:31:45Z
void main() {
class C { }
C[] csd;
C[2] css;
auto c1 = cast(C)csd;
auto c2 = cast(C)css;
}
---
test.d(6): Error: e2ir: cannot cast csd of type C[] to type test.main.C
test.d(7): Error: e2ir: cannot cast css of type C[2LU] to type test.main.C
---
(In reply to comment #0)
> void main() {
> class C { }
>
> C[] csd;
> C[2] css;
> auto c1 = cast(C)csd;
> auto c2 = cast(C)css;
> }
>
> ---
> test.d(6): Error: e2ir: cannot cast csd of type C[] to type test.main.C
> test.d(7): Error: e2ir: cannot cast css of type C[2LU] to type test.main.C
> ---
I think there's no "Internal Compiler Error". These are proper errors but just come from glue layer.
Comment #3 by github-bugzilla — 2013-07-16T11:36:18Z