summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-09-22 22:08:56 +0200
committerAndreas Rumpf <rumpf_a@web.de>2015-09-22 22:08:56 +0200
commit5e390dc7c727ab78a98b604b8f1d2ba8d08cee3f (patch)
tree5a8fb28fd50333187d66388e4c0e3a00244c543c /tests
parentba4dd92f457b9dd52fd6eddbd3f231b040750b60 (diff)
parent925e7b0ca139e73d8bbe0806b63c941b3e915fc7 (diff)
downloadNim-5e390dc7c727ab78a98b604b8f1d2ba8d08cee3f.tar.gz
Merge pull request #3361 from petermora/fixTypelessWarningInFuture
fixing TypelessParam warning in x=>x+1, added test
Diffstat (limited to 'tests')
-rw-r--r--tests/generics/tmap_auto.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/generics/tmap_auto.nim b/tests/generics/tmap_auto.nim
new file mode 100644
index 000000000..dea9b571f
--- /dev/null
+++ b/tests/generics/tmap_auto.nim
@@ -0,0 +1,13 @@
+import future
+
+let x = map(@[1, 2, 3], x => x+10)
+assert x == @[11, 12, 13]
+
+let y = map(@[(1,"a"), (2,"b"), (3,"c")], x => $x[0] & x[1])
+assert y == @["1a", "2b", "3c"]
+
+proc eatsTwoArgProc[T,S,U](a: T, b: S, f: proc(t: T, s: S): U): U =
+  f(a,b)
+
+let z = eatsTwoArgProc(1, "a", (t,s) => $t & s)
+assert z == "1a"