This commit is contained in:
Zahary Karadjov 2014-03-09 22:15:11 +02:00
commit 3dcf735482
3 changed files with 23 additions and 1 deletions

View file

@ -139,6 +139,10 @@ proc newSymG*(kind: TSymKind, n: PNode, c: PContext): PSym =
result = n.sym
internalAssert sfGenSym in result.flags
internalAssert result.kind == kind
# when there is a nested proc inside a template, semtmpl
# will assign a wrong owner during the first pass over the
# template; we must fix it here: see #909
result.owner = getCurrOwner()
else:
result = newSym(kind, considerAcc(n), getCurrOwner(), n.info)