summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-03-05 02:14:53 +0100
committerAraq <rumpf_a@web.de>2014-03-05 02:14:53 +0100
commitaa92669d9219816f9cd9036b4977ddbdd16d3c5d (patch)
treef024b3c52686061393b8c464a06b5c931725e649 /tests/vm
parent1ce30b9e100bd12394fa8f633137b4da4c98a1d9 (diff)
downloadNim-aa92669d9219816f9cd9036b4977ddbdd16d3c5d.tar.gz
fixes #937
Diffstat (limited to 'tests/vm')
-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..085bb6fb6
--- /dev/null
+++ b/tests/vm/twrongwhen.nim
@@ -0,0 +1,13 @@
+discard """
+  output: "Error: cannot evaluate at compile time: x"
+  line: 7
+"""
+
+proc bla(x:int) = 
+  when x == 0:
+    echo "oops"
+  else:
+    echo "good"
+
+bla(2)  # echos "oops"
+