summary refs log tree commit diff stats
path: root/tests/tuples/t9177.nim
blob: d5768b7036a164b72cf02923e3b9b20a09615f46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
discard """
  action: run
  disabled: true
"""

block:
  var x = (a: 5, b: 1)
  x = (3 * x.a + 2 * x.b, x.a + x.b)
  doAssert x.a == 17
  doAssert x.b == 6
block:
  # Transformation of a tuple constructor with named arguments
  var x = (a: 5, b: 1)
  x = (a: 3 * x.a + 2 * x.b, b: x.a + x.b)
  doAssert x.a == 17
  doAssert x.b == 6