Revert "Look up generic parameters when found inside semOverloadedCall, fixin… (#23054)"

This reverts commit 54bd380011.
This commit is contained in:
narimiran
2024-04-23 18:01:24 +02:00
parent 0e1a699937
commit e582f1ccb3
2 changed files with 0 additions and 22 deletions

View File

@@ -49,19 +49,6 @@ proc initCandidateSymbols(c: PContext, headSymbol: PNode,
while symx != nil:
if symx.kind in filter:
result.add((symx, o.lastOverloadScope))
elif symx.kind == skGenericParam:
#[
This code handles looking up a generic parameter when it's a static callable.
For instance:
proc name[T: static proc()]() = T()
name[proc() = echo"hello"]()
]#
for paramSym in searchInScopesAllCandidatesFilterBy(c, symx.name, {skConst}):
let paramTyp = paramSym.typ
if paramTyp.n.sym.kind in filter:
result.add((paramTyp.n.sym, o.lastOverloadScope))
symx = nextOverloadIter(o, c, headSymbol)
if result.len > 0:
initCandidate(c, best, result[0].s, initialBinding,

View File

@@ -1,9 +0,0 @@
proc consumer[T: static proc(i: int): int{.nimcall.}](i: int): int = T(i)
proc addIt(i: int): int = i + i
proc squareIt(i: int): int = i * i
assert consumer[addIt](10) == 20
assert consumer[squareIt](30) == 900
assert consumer[proc(i: int): int{.nimcall.} = i * i + i](10) == 110