-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
Description
type NoCopy = object
v:int
proc `=copy`(x: var NoCopy, y: NoCopy) {.error.}
proc `=destroy`(x: NoCopy) =
echo "destroy ", x.v
proc caller(f: proc()) =
f()
proc test2(vv: NoCopy) =
echo "in here ", vv.v
proc test() =
debugEcho "1"
var v = NoCopy(v: 3)
debugEcho "2"
caller(proc() = echo v.v)
debugEcho "4"
test2(v)
test()Nim Version
2.2.0
Current Output
1
destroy 0
2
3
4
in here 3
destroy 3
Expected Output
1
2
3
4
in here 3
destroy 3
Known Workarounds
No response
Additional Information
No response