module main; import std.stdio; void main(string[] args) { with(test()) { foo(); } } struct test { void foo() { writeln("foo"); } ~this() { writeln("destoy"); } }
prints: destroy foo Is this a bug?
Tofu Ninja via Digitalmars-d-learn Mon, 02 Feb 2015 19:56:08 -0800
module main; import std.stdio; void main(string[] args) { with(test()) { foo(); } } struct test { void foo() { writeln("foo"); } ~this() { writeln("destoy"); } }
prints: destroy foo Is this a bug?