tshallowseq.nim 186 B

123456789101112131415161718
  1. discard """
  2. output: '''@[1, 42, 3]
  3. @[1, 42, 3]
  4. '''
  5. """
  6. proc xxx() =
  7. var x: seq[int] = @[1, 2, 3]
  8. var y: seq[int]
  9. system.shallowCopy(y, x)
  10. y[1] = 42
  11. echo y
  12. echo x
  13. xxx()