Skip to content

Commit

Permalink
fixes a 'mixin' statement handling regression [backport:1.2] (#18968)
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored Oct 7, 2021
1 parent eede2bf commit 8eef557
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/semtempl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,14 @@ proc semBindStmt(c: PContext, n: PNode, toBind: var IntSet): PNode =

proc semMixinStmt(c: PContext, n: PNode, toMixin: var IntSet): PNode =
result = copyNode(n)
var count = 0
for i in 0..<n.len:
toMixin.incl(considerQuotedIdent(c, n[i]).id)
result.add symChoice(c, n[i], nil, scForceOpen)
let x = symChoice(c, n[i], nil, scForceOpen)
inc count, x.len
result.add x
if count == 0:
result = newNodeI(nkEmpty, n.info)

proc replaceIdentBySym(c: PContext; n: var PNode, s: PNode) =
case n.kind
Expand Down

0 comments on commit 8eef557

Please sign in to comment.