Extend init variable tracking to tuple assignments (#8321)

Fixes #8314
This commit is contained in:
LemonBoy 2018-07-17 17:50:05 +02:00 • committed by Andreas Rumpf
commit ebf4e9f717
2 changed files with 30 additions and 0 deletions

21
tests/init/t8314.nim Normal file
View file

@ -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)