fixes #3532
This commit is contained in:
parent
65c95e01e4
commit
660cd7ed70
1 changed files with 2 additions and 1 deletions
|
|
@ -17,7 +17,8 @@ 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): localError(n.info, errInvalidDiscard)
|
||||
if isEmptyType(n.sons[0].typ) or n.sons[0].typ.kind == tyNone:
|
||||
localError(n.info, errInvalidDiscard)
|
||||
|
||||
proc semBreakOrContinue(c: PContext, n: PNode): PNode =
|
||||
result = n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue