tdeepcopy_addr_rval.nim 175 B

1234567891011121314151617
  1. discard """
  2. output: "3"
  3. """
  4. # issue 5166
  5. type
  6. Test = ref object
  7. x: int
  8. let x = Test(x: 3)
  9. let p = cast[pointer](x)
  10. var v: Test
  11. deepCopy(v, cast[Test](p))
  12. echo v.x