Skip to content

Commit

Permalink
uses topLevelScope
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout committed Jan 24, 2025
1 parent 7ce4433 commit c70f67b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/semexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2449,7 +2449,10 @@ proc semQuoteAst(c: PContext, n: PNode): PNode =
dummyTemplate[paramsPos].add newTreeI(nkIdentDefs, n.info, ids[i], getSysSym(c.graph, n.info, "typed").newSymNode, c.graph.emptyNode)
# don't allow templates to capture syms without backticks
let oldScope = c.currentScope
c.currentScope = PScope(parent: nil, symbols: initStrTable(), depthLevel: 0)
# c.currentScope = PScope(parent: nil, symbols: initStrTable(), depthLevel: 0)
# TODO: allows toplevel syms to be captured for backwards compatibility
# perhaps `{.dirty.}` can be used for `dummyTemplate`
c.currentScope = c.topLevelScope
var tmpl = semTemplateDef(c, dummyTemplate)
c.currentScope = oldScope
quotes[0] = tmpl[namePos]
Expand Down

0 comments on commit c70f67b

Please sign in to comment.