t18079.nim 204 B

12345678910111213141516
  1. discard """
  2. matrix: "--mm:orc"
  3. """
  4. type
  5. Foo = object
  6. y: int
  7. Bar = object
  8. x: Foo
  9. proc baz(state: var Bar):int =
  10. state.x.y = 2
  11. state.x.y
  12. doAssert baz((ref Bar)(x: (new Foo)[])[]) == 2