From baf350493b08d5e1ee25f61b7d7eff33c3499487 Mon Sep 17 00:00:00 2001 From: SirOlaf <34164198+SirOlaf@users.noreply.github.com> Date: Thu, 10 Aug 2023 07:56:09 +0200 Subject: [PATCH] Fix #21760 (#22422) * Remove call-specific replaceTypeVarsN * Run for all call kinds and ignore typedesc * Testcase --------- Co-authored-by: SirOlaf <> --- compiler/seminst.nim | 4 ++-- tests/generics/t21760.nim | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 tests/generics/t21760.nim diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 22d28999d8..0dc3e3cfc9 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -275,9 +275,9 @@ proc instantiateProcType(c: PContext, pt: TIdTable, # call head symbol, because this leads to infinite recursion. if oldParam.ast != nil: var def = oldParam.ast.copyTree - if def.kind == nkCall: + if def.kind in nkCallKinds: for i in 1..