Bug 20749 – Invalid cast of class ref to AA isn't caught

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-04-19T11:37:42Z
Last change time
2024-12-13T19:08:11Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
kinke
Moved to GitHub: dmd#19692 →

Comments

Comment #0 by kinke — 2020-04-19T11:37:42Z
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); }
Comment #1 by robert.schadek — 2024-12-13T19:08:11Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19692 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB