Bug 24807 – Error message missing parens for template instance
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-10-12T17:19:59Z
Last change time
2024-10-20T04:19:16Z
Keywords
pull
Assigned to
No Owner
Creator
Tim
Comments
Comment #0 by tim.dlang — 2024-10-12T17:19:59Z
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)`
Comment #1 by dlang-bot — 2024-10-19T20:37:11Z
@ntrel created dlang/dmd pull request #17015 "Fix Bugzilla 24807 - Error message missing parens for template instance" fixing this issue:
- Fix Bugzilla 24807 - Error message missing parens for template instance
https://github.com/dlang/dmd/pull/17015
Comment #2 by dlang-bot — 2024-10-20T04:19:16Z
dlang/dmd pull request #17015 "Fix Bugzilla 24807 - Error message missing parens for template instance" was merged into master:
- f6d47b566437fe6da9713de742ddc9443ce3eb35 by Nick Treleaven:
Fix Bugzilla 24807 - Error message missing parens for template instance
https://github.com/dlang/dmd/pull/17015