https://issues.dlang.org/show_bug.cgi?id=14650

Jonathan M Davis <issues.dl...@jmdavisprog.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dl...@jmdavisprog.co
                   |                            |m

--- Comment #4 from Jonathan M Davis <issues.dl...@jmdavisprog.com> ---
Yeah, I just tested this after a discussion static variables and their liftemos
on D.Learn

-------------------
import std.stdio;

struct S
{
    this(string foo)
    {
        _foo = foo;
    }

    ~this()
    {
        writefln("%s destroyed", _foo);
    }

    string _foo;
}

void main()
{
    static mainStatic = S("main");
    auto s = S("local");
    f();
}

void f()
{
    static fStatic = S("f");
}
-------------------

It just prints out

local destroyed

The variables for the static destructors are never called.

--

Reply via email to