From 966029fc75e5ea0e0ff859a040924ffa7edad8a0 Mon Sep 17 00:00:00 2001 From: SixthDot Date: Mon, 16 Oct 2023 00:23:19 +0200 Subject: [PATCH] fix issue 23733 - Can't use template type parameter as type of alias parameter (#15691) --- compiler/src/dmd/dtemplate.d | 1 + compiler/test/runnable/template9.d | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/compiler/src/dmd/dtemplate.d b/compiler/src/dmd/dtemplate.d index 5583dd4790..23d1140fe3 100644 --- a/compiler/src/dmd/dtemplate.d +++ b/compiler/src/dmd/dtemplate.d @@ -8272,6 +8272,7 @@ MATCH matchArg(TemplateParameter tp, Scope* sc, RootObject oarg, size_t i, Templ */ if (tap.specType) { + tap.specType = typeSemantic(tap.specType, tap.loc, sc); Declaration d = (cast(Dsymbol)sa).isDeclaration(); if (!d) return matchArgNoMatch(); diff --git a/compiler/test/runnable/template9.d b/compiler/test/runnable/template9.d index fa70b81c78..7a55b2dbfe 100644 --- a/compiler/test/runnable/template9.d +++ b/compiler/test/runnable/template9.d @@ -5036,6 +5036,13 @@ void test15653() /******************************************/ +template foo23733(T, alias T a) {} + +int n23733; +alias _ = foo23733!(int, n23733); + +/******************************************/ + int main() { test1();