diff options
author | Araq <rumpf_a@web.de> | 2015-04-24 13:08:42 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-04-24 13:08:42 +0200 |
commit | 6ca38472a13840906d6f113eb92c11a25db49224 (patch) | |
tree | 97bff3450e2a3ec5ccea4c089c3f463c26ce3de6 /tests/parser | |
parent | a5f321ea8f0cee7929afaba8bb88bde477c37937 (diff) | |
download | Nim-6ca38472a13840906d6f113eb92c11a25db49224.tar.gz |
cleanups for underscores in tuple unpacking
Diffstat (limited to 'tests/parser')
-rw-r--r-- | tests/parser/ttupleunpack.nim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/parser/ttupleunpack.nim b/tests/parser/ttupleunpack.nim index 581e6e940..aaa06f9f4 100644 --- a/tests/parser/ttupleunpack.nim +++ b/tests/parser/ttupleunpack.nim @@ -4,6 +4,11 @@ discard """ exitcode: 0 """ +proc returnsTuple(): (int, int, int) = (4, 2, 3) + +proc main2 = + let (x, _, z) = returnsTuple() + proc main() = proc foo(): tuple[x, y, z: int] = @@ -16,8 +21,8 @@ proc main() = var (a, _, _) = foo() doAssert a == 4 - var (a, _, _xx) = foo() - doAssert a == 4 + var (aa, _, _) = foo() + doAssert aa == 4 iterator bar(): tuple[x, y, z: int] = yield (1,2,3) @@ -27,3 +32,4 @@ proc main() = doAssert y == 2 main() +main2() |