tobjfieldbyvar.nim 196 B

123456789101112131415161718192021
  1. discard """
  2. output: '''5
  3. '''
  4. """
  5. # bug #2798
  6. type Inner = object
  7. value: int
  8. type Outer = object
  9. i: Inner
  10. proc test(i: var Inner) =
  11. i.value += 5
  12. var o: Outer
  13. test(o.i)
  14. echo o.i.value