t18079.nim 166 B

123456789101112
  1. type
  2. Foo = object
  3. y: int
  4. Bar = object
  5. x: Foo
  6. proc baz(state: var Bar):int =
  7. state.x.y = 2
  8. state.x.y
  9. doAssert baz((ref Bar)(x: (new Foo)[])[]) == 2