+ also added an isGenericInstance parameter to onUse() for symmetry reasons (although the parameter is currently not used)

This commit is contained in:
Nikolay Nikolov
2024-05-14 18:31:21 +03:00
parent 339e55a9b7
commit 18132285b4
2 changed files with 7 additions and 7 deletions

View File

@@ -436,10 +436,10 @@ template getPContext(): untyped =
else: c.c
when defined(nimsuggest):
template onUse*(info: TLineInfo; s: PSym) = discard
template onUse*(info: TLineInfo; s: PSym; isGenericInstance = false) = discard
template onDefResolveForward*(info: TLineInfo; s: PSym) = discard
else:
template onUse*(info: TLineInfo; s: PSym) = discard
template onUse*(info: TLineInfo; s: PSym; isGenericInstance = false) = discard
template onDef*(info: TLineInfo; s: PSym) = discard
template onDefResolveForward*(info: TLineInfo; s: PSym) = discard

View File

@@ -684,11 +684,11 @@ proc semResolvedCall(c: PContext, x: var TCandidate,
var finalCallee = x.calleeSym
let info = getCallLineInfo(n)
markUsed(c, info, finalCallee, isGenericInstance = false)
onUse(info, finalCallee)
onUse(info, finalCallee, isGenericInstance = false)
assert finalCallee.ast != nil
if x.hasFauxMatch:
markUsed(c, info, finalCallee, isGenericInstance = true)
onUse(info, finalCallee)
onUse(info, finalCallee, isGenericInstance = true)
result = x.call
result[0] = newSymNode(finalCallee, getCallLineInfo(result[0]))
if containsGenericType(result.typ) or x.fauxMatch == tyUnknown:
@@ -724,7 +724,7 @@ proc semResolvedCall(c: PContext, x: var TCandidate,
else:
internalAssert c.config, false
markUsed(c, info, finalCallee, isGenericInstance = true)
onUse(info, finalCallee)
onUse(info, finalCallee, isGenericInstance = true)
result = x.call
instGenericConvertersSons(c, result, x)
@@ -792,9 +792,9 @@ proc explicitGenericSym(c: PContext, n: PNode, s: PSym): PNode =
newInst.typ.flags.excl tfUnresolved
let info = getCallLineInfo(n)
markUsed(c, info, s, isGenericInstance = false)
onUse(info, s)
onUse(info, s, isGenericInstance = false)
markUsed(c, info, newInst, isGenericInstance = true)
onUse(info, newInst)
onUse(info, newInst, isGenericInstance = true)
result = newSymNode(newInst, info)
proc setGenericParams(c: PContext, n, expectedParams: PNode) =