summary refs log tree commit diff stats
path: root/tests/misc/tstrange.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/tstrange.nim')
-rw-r--r--tests/misc/tstrange.nim28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/misc/tstrange.nim b/tests/misc/tstrange.nim
new file mode 100644
index 000000000..f8c063240
--- /dev/null
+++ b/tests/misc/tstrange.nim
@@ -0,0 +1,28 @@
+discard """
+output: '''
+hallo40
+1
+2
+'''
+"""
+# test for extremely strange bug
+
+proc ack(x: int, y: int): int =
+  if x != 0:
+    if y != 5:
+      return y
+    return x
+  return x+y
+
+proc gen[T](a: T) =
+  write(stdout, a)
+
+
+gen("hallo")
+write(stdout, ack(5, 4))
+#OUT hallo4
+
+# bug #1442
+let h=3
+for x in 0 ..< h.int:
+  echo x