From 04af9d4051a40a6d1c17be9730224678ce687d02 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 11 Feb 2018 17:43:56 +0100 Subject: [PATCH] fixes #3711 --- compiler/semstmts.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index f4614272c5..f0784021e8 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -17,7 +17,7 @@ proc semDiscard(c: PContext, n: PNode): PNode = checkSonsLen(n, 1) if n.sons[0].kind != nkEmpty: n.sons[0] = semExprWithType(c, n.sons[0]) - if isEmptyType(n.sons[0].typ) or n.sons[0].typ.kind == tyNone: + if isEmptyType(n.sons[0].typ) or n.sons[0].typ.kind == tyNone or n.sons[0].kind == nkTypeOfExpr: localError(n.info, errInvalidDiscard) proc semBreakOrContinue(c: PContext, n: PNode): PNode =