Files
Nim/tests/destructor/objFile.nim
Clyybber 0c869eaa47 Fix destructor injections for global variables (#11230)
* attach global destructors at end of mainModule
* Add testcase
* Minor cleanup
* Inject topLevelVar temporaries' destructors early
* Fix megatest
2019-05-13 08:28:33 +02:00

9 lines
124 B
Nim

type Obj* = object
v*: int
proc `=destroy`(this: var Obj) =
echo "igotdestroyed"
this.v = -1
var test* = Obj(v: 42)