fixes #9832 (#9841) [backport]

This commit is contained in:
Timothee Cour
2018-12-04 02:13:49 -08:00
committed by Andreas Rumpf
parent f86b827d9e
commit 05769020d3
2 changed files with 2 additions and 2 deletions

View File

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

View File

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