tvartypeclass.nim 320 B

1234567891011121314151617
  1. block: # issue #13302
  2. proc foo(x: object): int = x.i*2
  3. proc foo(x: var object) = x.i*=2
  4. type Foo = object
  5. i: int
  6. let x = Foo(i: 3)
  7. var y = Foo(i: 4)
  8. doAssert foo(x) == 6
  9. foo(y)
  10. doAssert y.i == 8
  11. block: # issue #24449
  12. proc p(x: var seq)= discard
  13. proc p(x: seq)= discard
  14. var s : seq[int]
  15. p(s)