diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-04-23 00:29:16 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-04-23 00:29:16 +0100 |
commit | f0f0062a5d37614b552c4ecc40ba2a189b00b008 (patch) | |
tree | b400b62d3383c3c91ea7aa46f7719e3efd6da9ec /tests/parser | |
parent | 9e69e4e078466886565565d6763b1e4794ea0670 (diff) | |
download | Nim-f0f0062a5d37614b552c4ecc40ba2a189b00b008.tar.gz |
Add sfGenSym for (_).
Diffstat (limited to 'tests/parser')
-rw-r--r-- | tests/parser/ttupleunpack.nim | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/tests/parser/ttupleunpack.nim b/tests/parser/ttupleunpack.nim index 3a1b77ea1..581e6e940 100644 --- a/tests/parser/ttupleunpack.nim +++ b/tests/parser/ttupleunpack.nim @@ -3,19 +3,27 @@ discard """ output: "" exitcode: 0 """ -proc foo(): tuple[x, y, z: int] = - return (4, 2, 3) -var (x, _, y) = foo() -doAssert x == 4 -doAssert y == 3 +proc main() = -var (a, _, _) = foo() -doAssert a == 4 + proc foo(): tuple[x, y, z: int] = + return (4, 2, 3) -iterator bar(): tuple[x, y, z: int] = - yield (1,2,3) + var (x, _, y) = foo() + doAssert x == 4 + doAssert y == 3 -for x, y, _ in bar(): - doAssert x == 1 - doAssert y == 2 + var (a, _, _) = foo() + doAssert a == 4 + + var (a, _, _xx) = foo() + doAssert a == 4 + + iterator bar(): tuple[x, y, z: int] = + yield (1,2,3) + + for x, y, _ in bar(): + doAssert x == 1 + doAssert y == 2 + +main() |