[Issue 24114] New: no crash on use of a noreturn enum member
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Aug 27 07:42:54 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24114
Issue ID: 24114
Summary: no crash on use of a noreturn enum member
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: b2.temp at gmx.com
For the following code there's no runtime crash
```
enum E {e1 = 1, e2 = 2, illegal = noreturn}
void main()
{
E e;
// that assignment should have the same effect as assert(0)
e = E.illegal;
// just to be sure
if (e) {}
}
```
--
More information about the Digitalmars-d-bugs
mailing list