[Issue 23733] New: Can't use template type parameter as type of alias parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 22 21:19:14 UTC 2023


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

          Issue ID: 23733
           Summary: Can't use template type parameter as type of alias
                    parameter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: snarwin+bugzilla at gmail.com

As of DMD v2.102.1, the following program fails to compile:

---
template foo(T, alias T a) {}

int n;
alias _ = foo!(int, n);
---

The error message is:

---
bug.d(4): Error: template instance `foo!(int, n)` does not match template
declaration `foo(T, alias T a)`
---

--


More information about the Digitalmars-d-bugs mailing list