Fix loop tuple unpacking in templates (#11174)
* Fix loop tuple unpacking in templates * Add test
This commit is contained in:
parent
094d71cb6f
commit
e42c304e4a
2 changed files with 14 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ output: '''
|
|||
@[(88, 99, 11), (88, 99, 11)]
|
||||
@[(7, 6, -28), (7, 6, -28)]
|
||||
12
|
||||
110100
|
||||
'''
|
||||
"""
|
||||
|
||||
|
|
@ -41,3 +42,11 @@ proc test[n]() =
|
|||
for (a,b) in @[(1,2)]:
|
||||
echo a,b
|
||||
test[string]()
|
||||
|
||||
iterator tuples: (int, (int, int)) = yield (1,(10, 100))
|
||||
|
||||
template t11164 =
|
||||
for i, (a, b) in tuples():
|
||||
echo i, a , b
|
||||
|
||||
t11164()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue