From 4f946cb44e4fe60451b8ce4d15868ef0bce6949a Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 5 Mar 2014 08:30:05 +0100 Subject: fixes #942 --- compiler/semstmts.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/semstmts.nim') diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index c8d9e353a..b2b3ceb6d 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1320,7 +1320,7 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode = if n.sons[i].typ == enforceVoidContext or usesResult(n.sons[i]): voidContext = true n.typ = enforceVoidContext - if i == last and efWantValue in flags: + if i == last and (length == 1 or efWantValue in flags): n.typ = n.sons[i].typ if not isEmptyType(n.typ): n.kind = nkStmtListExpr elif i != last or voidContext or c.inTypeClass > 0: -- cgit 1.4.1-2-gfad0