summary refs log tree commit diff stats
path: root/tests/tuples
diff options
context:
space:
mode:
authornc-x <neelesh.chandola@outlook.com>2019-05-05 15:52:41 +0530
committerAndreas Rumpf <rumpf_a@web.de>2019-05-05 12:22:41 +0200
commite42c304e4ae623ea8dea9594b531f119bb4142e9 (patch)
tree283c96baa6b4ab443e83cab7e71cde88879122b4 /tests/tuples
parent094d71cb6f6fbdedfd43a2bc6c66b227aedf1ddf (diff)
downloadNim-e42c304e4ae623ea8dea9594b531f119bb4142e9.tar.gz
Fix loop tuple unpacking in templates (#11174)
* Fix loop tuple unpacking in templates

* Add test
Diffstat (limited to 'tests/tuples')
-rw-r--r--tests/tuples/tfortupleunpack.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/tuples/tfortupleunpack.nim b/tests/tuples/tfortupleunpack.nim
index 9aeb7c5d6..e222a1ae6 100644
--- a/tests/tuples/tfortupleunpack.nim
+++ b/tests/tuples/tfortupleunpack.nim
@@ -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()