tnilstrs.nim 231 B

1234567891011121314151617
  1. block:
  2. var x: string
  3. var y = "foo"
  4. echo x
  5. doAssert x == ""
  6. doAssert "" == x
  7. add(x, y)
  8. y[0] = 'm'
  9. doAssert y == "moo" and x == "foo"
  10. block:
  11. var x = "foo".cstring
  12. var y: string
  13. add(y, x)
  14. doAssert y == "foo"