Bug 23367 – can't `new` an empty array of bottom values

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-09-24T11:27:27Z
Last change time
2024-12-13T19:24:42Z
Assigned to
No Owner
Creator
Ate Eskola
Moved to GitHub: dmd#20155 →

Comments

Comment #0 by Ajieskola — 2022-09-24T11:27:27Z
Compiled with a recent master DMD version, flags -preview=dip1000 -run ----------------------------- @safe void main() { new noreturn[](0); } ----------------------------- This program crashes at runtime. It should either compile and run succesfully, or fail compilation with "statement has no effect" error. Reason for that is because no bottom values are instantiated - the program is instantiating only an empty array.
Comment #1 by robert.schadek — 2024-12-13T19:24:42Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20155 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB