http://d.puremagic.com/issues/show_bug.cgi?id=6128

           Summary: Struct destructor isn't run when used in with
                    statement
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: simen.end...@pandavre.com


--- Comment #0 from simendsjo <simen.end...@pandavre.com> 2011-06-08 14:20:51 
PDT ---
This is using dmd 2.053 on win7 32bit

import std.stdio;
void main() {
    struct S {
        this(bool a) { writeln(" this"); }
        ~this() { writeln(" ~this"); }
    }

    writeln("scoped:");
    {
        auto s = S(true);
    }

    writeln("with:");
    with(S(true)) {
    }
}

Output:

scoped:
 this
 ~this
with:
 this

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to