This commit is contained in:
Timothee Cour
2018-12-04 07:48:08 -08:00
committed by Andreas Rumpf
parent e3e5ae287f
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
of nkPragma, nkCommentStmt, nkNilLit, nkEmpty, nkBlockExpr,
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
if result.len == 1 and

View File

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