diff options
author | Araq <rumpf_a@web.de> | 2012-08-13 17:07:49 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-08-13 17:07:49 +0200 |
commit | 244c14db0ba5c71a04be9486704994c774c5648b (patch) | |
tree | 7026ea267830246119e49f303ed2dd8320c71e0a /tests/run | |
parent | f686647f58c67d90f051dedf441f9b3eb913899b (diff) | |
download | Nim-244c14db0ba5c71a04be9486704994c774c5648b.tar.gz |
top level closures should work; transf is not a pass anymore; next steps for first class iterator support
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/tunittests.nim | 4 | ||||
-rw-r--r-- | tests/run/uclosures.nim | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/tests/run/tunittests.nim b/tests/run/tunittests.nim index e4c92c9e9..c77f691d9 100644 --- a/tests/run/tunittests.nim +++ b/tests/run/tunittests.nim @@ -1,3 +1 @@ -import utemplates - -# uclosures +import utemplates, uclosures diff --git a/tests/run/uclosures.nim b/tests/run/uclosures.nim index d54b88285..6eea29ca1 100644 --- a/tests/run/uclosures.nim +++ b/tests/run/uclosures.nim @@ -4,7 +4,8 @@ test "loop variables are captured by copy": var funcs: seq[proc (): int {.closure.}] = @[] for i in 0..10: - funcs.add do -> int: return i * i + let ii = i + funcs.add do -> int: return ii * ii check funcs[0]() == 0 check funcs[3]() == 9 |