fixing TypelessParam warning in x=>x+1, added test

This commit is contained in:
Peter Mora
2015-09-22 18:34:43 +02:00
parent ba4dd92f45
commit 925e7b0ca1
2 changed files with 15 additions and 2 deletions

View File

@@ -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"