summary refs log tree commit diff stats
path: root/tests/varres/tvartup.nim
blob: 20a4156e6a284f473849fb946c5ff3f7c12aef16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  file: "tvartup.nim"
  output: "2 3"
"""
# Test the new tuple unpacking

proc divmod(a, b: int): tuple[di, mo: int] =
  return (a div b, a mod b)

var (x, y) = divmod(15, 6)
stdout.write(x)
stdout.write(" ")
stdout.write(y)

#OUT 2 3