Skip to content

Commit

Permalink
fixes isLocalVarSym; an implicit global is a global nonetheless (#2…
Browse files Browse the repository at this point in the history
…1025)

fixes isLocalVarSym; an implicit global is a global nonetheless

(cherry picked from commit a8090f7)
  • Loading branch information
ringabout authored and narimiran committed May 12, 2023
1 parent 98756bb commit c641273
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions compiler/semstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,11 @@ proc errorSymChoiceUseQualifier(c: PContext; n: PNode) =
localError(c.config, n.info, errGenerated, err)

template isLocalVarSym(n: PNode): bool =
n.kind == nkSym and
n.sym.kind in {skVar, skLet} and not
({sfGlobal, sfPure} <= n.sym.flags or
n.kind == nkSym and
n.sym.kind in {skVar, skLet} and not
({sfGlobal, sfPure} * n.sym.flags != {} or
sfCompileTime in n.sym.flags)

proc usesLocalVar(n: PNode): bool =
for z in 1 ..< n.len:
if n[z].isLocalVarSym:
Expand Down Expand Up @@ -2117,7 +2117,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
if s.kind notin {skMacro, skTemplate} and s.magic == mNone: paramsTypeCheck(c, s.typ)

maybeAddResult(c, s, n)
let resultType =
let resultType =
if s.kind == skMacro:
sysTypeFromName(c.graph, n.info, "NimNode")
elif not isInlineIterator(s.typ):
Expand Down

0 comments on commit c641273

Please sign in to comment.