mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
* 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:
@@ -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)):
|
||||
|
||||
8
tests/generics/t21760.nim
Normal file
8
tests/generics/t21760.nim
Normal 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)
|
||||
Reference in New Issue
Block a user