[Issue 20749] New: Invalid cast of class ref to AA isn't caught
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 19 11:37:42 UTC 2020
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: nobody at puremagic.com
Reporter: kinke at gmx.net
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);
}
--
More information about the Digitalmars-d-bugs
mailing list