From 2fa314a89da5e23dea24d0825d1161d76828a4c0 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 <> (cherry picked from commit baf350493b08d5e1ee25f61b7d7eff33c3499487) --- 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 5b0fe6ba25..8d50a1c37e 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -272,9 +272,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..