This commit is contained in:
Araq
2019-04-17 17:26:59 +02:00
parent 850e90ac30
commit 7640a230fc
3 changed files with 34 additions and 7 deletions

View File

@@ -4,7 +4,8 @@ discard """
ho
ha
@["arg", "asdfklasdfkl", "asdkfj", "dfasj", "klfjl"]
22 22'''
@[1, 2, 3]
25 25'''
"""
import allocators
@@ -132,6 +133,24 @@ proc other =
other()
# bug #11050
type
Obj* = object
f*: seq[int]
method main(o: Obj) =
for newb in o.f:
discard
# test that o.f was not moved!
proc testforNoMove =
var o = Obj(f: @[1, 2, 3])
main(o)
echo o.f
testforNoMove()
#echo s
let (a, d) = allocCounters()
discard cprintf("%ld %ld\n", a, d)