https://issues.dlang.org/show_bug.cgi?id=24117

          Issue ID: 24117
           Summary: noreturn can be used as expression
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: b2.t...@gmx.com

Example 1, in an AddExpression:

```d
int v(e)()
{
    return e + 0;
}

int main()
{
    return v!(noreturn)();
} 
```

Example 2, as EnumMember initializer:

```d
enum E {e1 = 1, e2 = 2, illegal = noreturn}

void main()
{
    E e;
    e = E.illegal;
}
```

--

Reply via email to