fixes a 'mixin' statement handling regression [backport:1.2] (#18968)

(cherry picked from commit 8eef557157)
This commit is contained in:
Andreas Rumpf
2021-10-07 12:01:06 +02:00
committed by narimiran
parent a8aaf5a27d
commit 68df3c9afd

View File

@@ -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