Nim/tests/ccgbugs/tdeepcopy_addr_rval.nim
2017-01-15 06:26:59 +01:00

16 lines
175 B
Nim

discard """
output: "3"
"""
# issue 5166
type
Test = ref object
x: int
let x = Test(x: 3)
let p = cast[pointer](x)
var v: Test
deepCopy(v, cast[Test](p))
echo v.x