From d84ace8a5b7d1a875b5beaf1330e1d80931f3ef9 Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Tue, 30 Jan 2018 17:25:41 +0300 Subject: [PATCH] Fixes #7140 (#7154) --- compiler/sempass2.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index d427750e40..e560c18c85 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -747,7 +747,7 @@ proc track(tracked: PEffects, n: PNode) = # may not look like an assignment, but it is: let arg = n.sons[1] initVarViaNew(tracked, arg) - if {tfNeedsInit} * arg.typ.lastSon.flags != {}: + if arg.typ.len != 0 and {tfNeedsInit} * arg.typ.lastSon.flags != {}: if a.sym.magic == mNewSeq and n[2].kind in {nkCharLit..nkUInt64Lit} and n[2].intVal == 0: # var s: seq[notnil]; newSeq(s, 0) is a special case!