From c3319fcad5e234cb3add0183d6894df1b5d04bfc Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Tue, 4 Dec 2018 02:13:49 -0800 Subject: [PATCH] fixes #9832 (#9841) [backport] (cherry picked from commit 05769020d3f9eb2b13c8b61613fd5e52a397624d) --- compiler/semstmts.nim | 2 +- tests/controlflow/tstatret.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 2817b5ef95..a015d3a1bf 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1936,7 +1936,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 diff --git a/tests/controlflow/tstatret.nim b/tests/controlflow/tstatret.nim index 04cac99665..8327d3ee3a 100644 --- a/tests/controlflow/tstatret.nim +++ b/tests/controlflow/tstatret.nim @@ -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() =