summary refs log tree commit diff stats
path: root/tests/generics
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2014-02-18 02:46:14 +0200
committerZahary Karadjov <zahary@gmail.com>2014-02-18 02:46:14 +0200
commitcda92048ba9408d356e0023543fcfb45ea357da8 (patch)
tree13592e624ea1dcf45346af002a6a699a6429e683 /tests/generics
parent4d3846e26b38ddf7fade05489f0f3335db057950 (diff)
downloadNim-cda92048ba9408d356e0023543fcfb45ea357da8.tar.gz
fix some trivial errors in the test suite and some more regressions caused by tyTypeDesc[tyNone]
Diffstat (limited to 'tests/generics')
-rw-r--r--tests/generics/tgenericlambda.nim10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/generics/tgenericlambda.nim b/tests/generics/tgenericlambda.nim
index a71c592c5..f7aafe1d9 100644
--- a/tests/generics/tgenericlambda.nim
+++ b/tests/generics/tgenericlambda.nim
@@ -1,5 +1,5 @@
 discard """
-  output: "10\n10"
+  output: "10\n10\n1\n2\n3"
 """
 
 proc test(x: proc (a, b: int): int) =
@@ -8,3 +8,11 @@ proc test(x: proc (a, b: int): int) =
 test(proc (a, b): auto = a + b)
 
 test do (a, b) -> auto: a + b
+
+proc foreach[T](s: seq[T], body: proc(x: T)) =
+  for e in s:
+    body(e)
+
+foreach(@[1,2,3]) do (x):
+  echo x
+