fixes #12827 (#12829) [backport]

This commit is contained in:
cooldome 2019-12-10 06:08:46 +00:00 • committed by Andreas Rumpf
commit 13d232ec56
2 changed files with 22 additions and 4 deletions

View file

@ -7,6 +7,7 @@ axc
0 new: 0
...
destroying GenericObj[T] GenericObj[system.int]
test
'''
"""
@ -117,3 +118,19 @@ proc main12() =
echo "..."
main12()
#####################################################################
## bug #12827
type
MyObject = object
x: string
y: seq[string]
needs_ref: ref int
proc xx(xml: string): MyObject =
let stream = xml
result.x = xml
defer: echo stream
discard xx("test")