* attach global destructors at end of mainModule * Add testcase * Minor cleanup * Inject topLevelVar temporaries' destructors early * Fix megatest
8 lines
124 B
Nim
8 lines
124 B
Nim
type Obj* = object
|
|
v*: int
|
|
|
|
proc `=destroy`(this: var Obj) =
|
|
echo "igotdestroyed"
|
|
this.v = -1
|
|
|
|
var test* = Obj(v: 42)
|