diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-07-17 17:50:05 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-07-17 17:50:05 +0200 |
commit | ebf4e9f7177da28fad4b81c74d4fc184581e9a70 (patch) | |
tree | 563533f8ba53324b284c5260f8b60906ec822993 /tests/init | |
parent | fc0bcccc15ec5cf3351cf65b22c7a038d82d4b35 (diff) | |
download | Nim-ebf4e9f7177da28fad4b81c74d4fc184581e9a70.tar.gz |
Extend init variable tracking to tuple assignments (#8321)
Fixes #8314
Diffstat (limited to 'tests/init')
-rw-r--r-- | tests/init/t8314.nim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/init/t8314.nim b/tests/init/t8314.nim new file mode 100644 index 000000000..59d46eb33 --- /dev/null +++ b/tests/init/t8314.nim @@ -0,0 +1,21 @@ +discard """ + nimout: ''' +t8314.nim(8, 7) Hint: BEGIN [User] +t8314.nim(19, 7) Hint: END [User] + ''' +""" + +{.hint: "BEGIN".} +proc foo(x: range[1..10]) = + block: + var (y,) = (x,) + echo y + block: + var (_,y) = (1,x) + echo y + block: + var (y,_,) = (x,1,) + echo y +{.hint: "END".} + +foo(1) |