https://issues.dlang.org/show_bug.cgi?id=20749
Issue ID: 20749
Summary: Invalid cast of class ref to AA isn't caught
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
This wrongly compiles, then segfaults at runtime:
class Empty {}
void main()
{
auto e = new Empty;
auto aa = cast(Empty[string]) e;
import std.stdio;
writeln(aa);
}
--
