summary refs log tree commit diff stats
path: root/tests/controlflow/tstatret.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/controlflow/tstatret.nim')
-rw-r--r--tests/controlflow/tstatret.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/controlflow/tstatret.nim b/tests/controlflow/tstatret.nim
new file mode 100644
index 000000000..a3558e6f4
--- /dev/null
+++ b/tests/controlflow/tstatret.nim
@@ -0,0 +1,9 @@
+discard """
+  nimout: '''
+tstatret.nim(9, 7) Warning: unreachable code after 'return' statement or '{.noReturn.}' proc [UnreachableCode]
+'''
+"""
+# no statement after return
+proc main() =
+  return
+  echo("huch?") #ERROR_MSG statement not allowed after