https://issues.dlang.org/show_bug.cgi?id=24112
Issue ID: 24112
Summary: binary expressions with noreturn vars produce
inconsistent results
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: rejects-valid, wrong-code
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
```
noreturn foo;
int a = foo / 1;
int b = foo + 1;
int c = foo - 1;
int d = foo * 1;
int e = foo % 1;
int f = foo ^^ 1;
int g = foo & 1;
int h = foo | 1;
int i = foo ^ 1;
int j = foo << 1;
int k = foo >> 1;
int l = foo >>> 1;
```
As of DMD 2.105.0, none of these statements produce the expected runtime
errors. noreturn vars appear to be treated as integers with the value 0, except
in the last three statements, which result in a compile error instead.
--