[Issue 24807] New: Error message missing parens for template instance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 12 17:19:59 UTC 2024


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

          Issue ID: 24807
           Summary: Error message missing parens for template instance
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: tim.dlang at t-online.de

DMD produces a bad error message for the following code:
```
enum E
{
    a,b,c
}
template X(E e)
{
    static assert(false);
}
alias Y = X!(E.a);
```

The error message is:
```
test.d(7): Error: static assert:  `false` is false
test.d(9):        instantiated from here: `X!E.a`
```

The code `X!E.a` in the error message is wrong, because it would be parsed as
`(X!E).a`. Correct would be `X!(E.a)`

--


More information about the Digitalmars-d-bugs mailing list