[Issue 21354] New: 'cannot deduce function' errors print enum template params in an ugly way

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 1 20:05:07 UTC 2020


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

          Issue ID: 21354
           Summary: 'cannot deduce function' errors print enum template
                    params in an ugly way
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: elpenguino+D at gmail.com

```
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`.

--


More information about the Digitalmars-d-bugs mailing list