diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-09-22 22:08:56 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-09-22 22:08:56 +0200 |
commit | 5e390dc7c727ab78a98b604b8f1d2ba8d08cee3f (patch) | |
tree | 5a8fb28fd50333187d66388e4c0e3a00244c543c /tests | |
parent | ba4dd92f457b9dd52fd6eddbd3f231b040750b60 (diff) | |
parent | 925e7b0ca139e73d8bbe0806b63c941b3e915fc7 (diff) | |
download | Nim-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.nim | 13 |
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" |