Bug 21354 – 'cannot deduce function' errors print enum template params in an ugly way
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-11-01T20:05:07Z
Last change time
2022-03-23T17:26:08Z
Keywords
diagnostic
Assigned to
No Owner
Creator
elpenguino+D
Comments
Comment #0 by elpenguino+D — 2020-11-01T20:05:07Z
```
enum Test {
a,
b
}
void test(Test t : Test.a)() {}
void main() {
test!(Test.b)();
}
```
This code, on DMD 2.094.1 and earlier, prints the error `Error: template instance test!(cast(Test)1) does not match template declaration test(Test t : (Test).a)()`. This is also true when there are multiple matching candidates. dmd should print `Test.b` rather than `cast(Test)1`.
Comment #1 by moonlightsentinel — 2022-03-23T17:26:08Z
Since 2.095.1: Failure with output: onlineapp.d(9): Error: template instance `test!(Test.b)` does not match template declaration `test(Test t : (Test).a)()`