Skip to content

Commit 30cbd25

Browse files
committed
progress
1 parent cae09aa commit 30cbd25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/injectdestructors.nim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,10 @@ template handleNestedTempl(n, processCall: untyped, willProduceStmt = false,
649649
of nkStmtList, nkStmtListExpr:
650650
# a statement list does not open a new scope
651651
if n.len == 0: return n
652-
result = copyNode(n)
652+
if isEmptyType(n.typ) or willProduceStmt:
653+
result = newNodeI(nkStmtList, n.info)
654+
else:
655+
result = copyNode(n)
653656
for i in 0..<n.len-1:
654657
result.add p(n[i], c, s, normal)
655658
result.add maybeVoid(n[^1], s)

0 commit comments

Comments
 (0)