This commit is contained in:
Timothee Cour 2018-12-04 07:48:08 -08:00 • committed by Andreas Rumpf
commit d502ddea9e
2 changed files with 3 additions and 2 deletions

View file

@ -1963,7 +1963,8 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
case n.sons[j].kind case n.sons[j].kind
of nkPragma, nkCommentStmt, nkNilLit, nkEmpty, nkBlockExpr, of nkPragma, nkCommentStmt, nkNilLit, nkEmpty, nkBlockExpr,
nkBlockStmt, nkState: discard nkBlockStmt, nkState: discard
else: localError(c.config, n.sons[j].info, "unreachable statement after '{.noReturn.}' proc") else: localError(c.config, n.sons[j].info,
"unreachable statement after 'return' statement or '{.noReturn.}' proc")
else: discard else: discard
if result.len == 1 and if result.len == 1 and

View file

@ -1,7 +1,7 @@
discard """ discard """
file: "tstatret.nim" file: "tstatret.nim"
line: 9 line: 9
errormsg: "unreachable statement after '{.noReturn.}' proc" errormsg: "unreachable statement after 'return' statement or '{.noReturn.}' proc"
""" """
# no statement after return # no statement after return
proc main() = proc main() =