allowing definitions of procs and templates to be overridden in local scopes

This commit is contained in:
Zahary Karadjov 2012-03-14 20:57:13 +02:00
commit d1d5fc8254
3 changed files with 20 additions and 7 deletions

View file

@ -36,14 +36,15 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
template best: expr = result
#Message(n.info, warnUser, renderTree(n))
var sym = initOverloadIter(o, c, f)
var symScope = o.lastOverloadScope
if sym == nil: return
initCandidate(best, sym, initialBinding)
initCandidate(alt, sym, initialBinding)
if sym == nil: return
initCandidate(best, sym, initialBinding, symScope)
initCandidate(alt, sym, initialBinding, symScope)
while sym != nil:
if sym.kind in filter:
initCandidate(z, sym, initialBinding)
initCandidate(z, sym, initialBinding, o.lastOverloadScope)
z.calleeSym = sym
matches(c, n, orig, z)
if z.state == csMatch: