summary refs log blame commit diff stats
path: root/tests/assign/moverload_asgn2.nim
blob: cfea48cd1c2e1272146a70f4578b7a08007302ba (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14



                     









                                          
discard """
  matrix: "--mm:refc"
"""

type
  Concrete* = object
    a*, b*: string
    rc*: int # refcount

proc `=`(d: var Concrete; src: Concrete) =
  shallowCopy(d.a, src.a)
  shallowCopy(d.b, src.b)
  dec d.rc
  d.rc = src.rc + 1