summary refs log tree commit diff stats
path: root/tests/controlflow/tunreachable2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/controlflow/tunreachable2.nim')
-rw-r--r--tests/controlflow/tunreachable2.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/controlflow/tunreachable2.nim b/tests/controlflow/tunreachable2.nim
new file mode 100644
index 000000000..a658880f0
--- /dev/null
+++ b/tests/controlflow/tunreachable2.nim
@@ -0,0 +1,12 @@
+discard """
+  matrix: "--warningAsError:UnreachableCode"
+"""
+
+proc test(): bool =
+  block okay:
+    if true: break okay
+    return false
+
+  return true # Line 7 is here
+
+doAssert test()