fix mapIt issues #12625 & #12639 (#14041)

* fix mapIt issues #12625 & #12639:

1. fallback to call `map` when the result of `op` is a closure;
2. use `items(s)` in the for loop.

* fix test errors.

* add comments and InType is moved.

* fix ident.
This commit is contained in:
Judd 2020-04-21 20:50:16 +08:00 • committed by GitHub
commit 04c326569b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 14 deletions

View file

@ -204,3 +204,6 @@ block ttoseq:
var y: type("a b c".split)
y = "xzy"
stdout.write("\n")
block tseqmapitchain:
doAssert @[101, 102] == [1, 2].mapIt(func (x: int): int = it + x).mapIt(it(100))