t9177.nim 333 B

1234567891011121314151617
  1. discard """
  2. action: run
  3. disabled: true
  4. """
  5. block:
  6. var x = (a: 5, b: 1)
  7. x = (3 * x.a + 2 * x.b, x.a + x.b)
  8. doAssert x.a == 17
  9. doAssert x.b == 6
  10. block:
  11. # Transformation of a tuple constructor with named arguments
  12. var x = (a: 5, b: 1)
  13. x = (a: 3 * x.a + 2 * x.b, b: x.a + x.b)
  14. doAssert x.a == 17
  15. doAssert x.b == 6