fixes isLocalVarSym; an implicit global is a global nonetheless (#21025)

fixes isLocalVarSym; an implicit global is a global nonetheless
This commit is contained in:
ringabout 2022-12-06 05:24:36 +08:00 • committed by GitHub
commit a8090f7d65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -588,7 +588,7 @@ proc semVarMacroPragma(c: PContext, a: PNode, n: PNode): PNode =
template isLocalVarSym(n: PNode): bool = template isLocalVarSym(n: PNode): bool =
n.kind == nkSym and n.kind == nkSym and
(n.sym.kind in {skVar, skLet} and not (n.sym.kind in {skVar, skLet} and not
({sfGlobal, sfPure} <= n.sym.flags or ({sfGlobal, sfPure} * n.sym.flags != {} or
sfCompileTime in n.sym.flags) or sfCompileTime in n.sym.flags) or
n.sym.kind in {skProc, skFunc, skIterator} and n.sym.kind in {skProc, skFunc, skIterator} and
sfGlobal notin n.sym.flags sfGlobal notin n.sym.flags