Skip to content

Commit

Permalink
fixes nim-lang#9832 (nim-lang#9841) [backport]
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour authored and Araq committed Dec 4, 2018
1 parent f86b827 commit 0576902
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/semstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/controlflow/tstatret.nim
Original file line number Diff line number Diff line change
@@ -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() =
Expand Down

0 comments on commit 0576902

Please sign in to comment.