summary refs log tree commit diff stats
path: root/tests/ccgbugs/t5701.nim
blob: ee6e4849824f01b5cbf663384167dc3d46acfcf8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  output: '''(1, 1)
(2, 2)
(3, 3)
'''
"""

iterator zip[T1, T2](a: openarray[T1], b: openarray[T2]): iterator() {.inline.} =
  let len = min(a.len, b.len)
  for i in 0..<len:
    echo (a[i], b[i])

proc foo(args: varargs[int]) =
  for i in zip(args,args):
    discard

foo(1,2,3)