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














                                                              
discard """
  action: run
"""

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