summary refs log tree commit diff stats
path: root/tests/vm/twrongwhen.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm/twrongwhen.nim')
-rw-r--r--tests/vm/twrongwhen.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/vm/twrongwhen.nim b/tests/vm/twrongwhen.nim
new file mode 100644
index 000000000..d67e42883
--- /dev/null
+++ b/tests/vm/twrongwhen.nim
@@ -0,0 +1,13 @@
+discard """
+  errormsg: "cannot evaluate at compile time: x"
+  line: 7
+"""
+
+proc bla(x:int) =
+  when x == 0:
+    echo "oops"
+  else:
+    echo "good"
+
+bla(2)  # echos "oops"
+