diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2018-12-04 02:13:49 -0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-12-04 11:13:49 +0100 |
commit | 05769020d3f9eb2b13c8b61613fd5e52a397624d (patch) | |
tree | dd93d6b2395f95c9ed87ab1cf84b3828e4d1bad2 | |
parent | f86b827d9e10f0178f1bb89d1c7df8c6b7b7eba0 (diff) | |
download | Nim-05769020d3f9eb2b13c8b61613fd5e52a397624d.tar.gz |
fixes #9832 (#9841) [backport]
-rw-r--r-- | compiler/semstmts.nim | 2 | ||||
-rw-r--r-- | tests/controlflow/tstatret.nim | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 2af34646c..425355fcd 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -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 diff --git a/tests/controlflow/tstatret.nim b/tests/controlflow/tstatret.nim index 04cac9966..8327d3ee3 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() = |