February 22, 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@puremagic.com
          Reporter: snarwin+bugzilla@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)`
---

--