diff options
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r-- | compiler/semstmts.nim | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index fc98ff703..b16dbde58 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -773,7 +773,7 @@ proc addParams(c: PContext, n: PNode, kind: TSymKind) = proc semBorrow(c: PContext, n: PNode, s: PSym) = # search for the correct alias: - var b = SearchForBorrowProc(c, s, c.tab.tos - 2) + var b = SearchForBorrowProc(c, c.currentScope.parent, s) if b != nil: # store the alias: n.sons[bodyPos] = newSymNode(b) @@ -919,8 +919,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, n.sons[patternPos] = semPattern(c, n.sons[patternPos]) if s.kind == skIterator: s.typ.flags.incl(tfIterator) - var proto = SearchForProc(c, s, c.tab.tos-2) # -2 because we have a scope - # open for parameters + var proto = SearchForProc(c, outerScope, s) if proto == nil: s.typ.callConv = lastOptionEntry(c).defaultCC # add it here, so that recursive procs are possible: |