summary refs log tree commit diff stats
path: root/tests/generics
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2014-03-15 11:23:46 +0200
committerZahary Karadjov <zahary@gmail.com>2014-03-16 20:42:06 +0200
commitcf8fe16a48d79d149f6ce85e229d23c1513c2497 (patch)
treefa231d9755120954f4f9b66b7e32528e98f3b1cc /tests/generics
parent7080d02af47cdc459aa441baa76d06f32af2f1c3 (diff)
downloadNim-cf8fe16a48d79d149f6ce85e229d23c1513c2497.tar.gz
fix #715 again
the regression was caused by the introduction of "generic" lambdas
Diffstat (limited to 'tests/generics')
-rw-r--r--tests/generics/tbadgenericlambda.nim7
-rw-r--r--tests/generics/tgenericlambda.nim7
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/generics/tbadgenericlambda.nim b/tests/generics/tbadgenericlambda.nim
new file mode 100644
index 000000000..5e406cacc
--- /dev/null
+++ b/tests/generics/tbadgenericlambda.nim
@@ -0,0 +1,7 @@
+discard """
+  msg: "nested proc can have generic parameters only when"
+  line: 6
+"""
+
+let x = proc (x, y): auto = x + y
+
diff --git a/tests/generics/tgenericlambda.nim b/tests/generics/tgenericlambda.nim
index f7aafe1d9..eb6ada3e5 100644
--- a/tests/generics/tgenericlambda.nim
+++ b/tests/generics/tgenericlambda.nim
@@ -1,5 +1,5 @@
 discard """
-  output: "10\n10\n1\n2\n3"
+  output: "10\n10\n1\n2\n3\n15"
 """
 
 proc test(x: proc (a, b: int): int) =
@@ -16,3 +16,8 @@ proc foreach[T](s: seq[T], body: proc(x: T)) =
 foreach(@[1,2,3]) do (x):
   echo x
 
+proc foo =
+  let x = proc (a, b: int): auto = a + b
+  echo x(5, 10)
+
+foo()