* Remove call-specific replaceTypeVarsN

* Run for all call kinds and ignore typedesc

* Testcase

---------

Co-authored-by: SirOlaf <>
(cherry picked from commit baf350493b)
This commit is contained in:
SirOlaf
2023-08-10 07:56:09 +02:00
committed by narimiran
parent bd63124a00
commit 2fa314a89d
2 changed files with 10 additions and 2 deletions

View File

@@ -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..<def.len:
def[i] = replaceTypeVarsN(cl, def[i])
def[i] = replaceTypeVarsN(cl, def[i], 1)
def = semExprWithType(c, def)
if def.referencesAnotherParam(getCurrOwner(c)):

View File

@@ -0,0 +1,8 @@
import std/tables
type Url = object
proc myInit(_: type[Url], params = default(Table[string, string])): Url =
discard
discard myInit(Url)