Create temp var in deepcopy if needed (#5205)

This commit is contained in:
Brandon Pickering 2017-01-14 21:26:59 -08:00 • committed by Andreas Rumpf
commit 9f95dd8e1d
2 changed files with 27 additions and 2 deletions

View file

@ -0,0 +1,16 @@
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