This commit is contained in:
Araq
2018-02-11 17:43:56 +01:00
parent fc967cc715
commit 04af9d4051

View File

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