www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24116] New: no return not accepted as argument of a template

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

          Issue ID: 24116
           Summary: no return not accepted as argument of a template value
                    parameter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

For the following code

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

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

dmd exits with:

 temp_7F361AD45870.d:8:12: Error: template instance `v!(noreturn)` does not
match template declaration `v(int e)()`
But noreturn is supposed to implictly convert to `int` --
Aug 27 2023