diff options
author | Clyybber <darkmine956@gmail.com> | 2019-05-13 08:28:33 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-05-13 08:28:33 +0200 |
commit | 0c869eaa475caab9558aaf5b39b8e3519388f811 (patch) | |
tree | 6a1ee425e34f811c6e82cd6e48145465dad3a7d5 /tests/destructor/objFile.nim | |
parent | a3e27ffa2c721b2ef3b0481d7db5c45039072050 (diff) | |
download | Nim-0c869eaa475caab9558aaf5b39b8e3519388f811.tar.gz |
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
Diffstat (limited to 'tests/destructor/objFile.nim')
-rw-r--r-- | tests/destructor/objFile.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/destructor/objFile.nim b/tests/destructor/objFile.nim new file mode 100644 index 000000000..436c090d1 --- /dev/null +++ b/tests/destructor/objFile.nim @@ -0,0 +1,8 @@ +type Obj* = object + v*: int + +proc `=destroy`(this: var Obj) = + echo "igotdestroyed" + this.v = -1 + +var test* = Obj(v: 42) |