fixes #10689
This commit is contained in:
parent
289b5e9ef9
commit
322ce1872f
2 changed files with 22 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ discard """
|
|||
output: '''(field: "value")
|
||||
Indeed
|
||||
axc
|
||||
(v: 10)
|
||||
0 new: 0'''
|
||||
"""
|
||||
|
||||
|
|
@ -58,5 +59,21 @@ proc test(p: owned proc()) =
|
|||
|
||||
test(proc() = discard)
|
||||
|
||||
# bug #10689
|
||||
|
||||
type
|
||||
O = object
|
||||
v: int
|
||||
|
||||
proc `=sink`(d: var O, s: O) =
|
||||
d.v = s.v
|
||||
|
||||
proc selfAssign =
|
||||
var o = O(v: 10)
|
||||
o = o
|
||||
echo o
|
||||
|
||||
selfAssign()
|
||||
|
||||
let (a, d) = allocCounters()
|
||||
discard cprintf("%ld new: %ld\n", a - unpairedEnvAllocs() - d, allocs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue