www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3441] New: Snow Leopard: Static constructors do not work

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3441

           Summary: Snow Leopard: Static constructors do not work
           Product: D
           Version: 1.050
          Platform: All
        OS/Version: Mac OS X
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: david icy.com.au


--- Comment #0 from David <david icy.com.au> 2009-10-25 22:43:19 PDT ---
import std.stdio;

class Foo {
    static int foo = 42;
    static this() {
        writefln("static constructor");
        foo = 128;
    }
}

int main() {
    writefln("main: %s", Foo.foo);
    return 0;
}

will print
"main: 42"

Static constructor never called.

(Same code works as expected on normal Leopard, this has only been seen on Snow
Leopard)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 25 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3441


Sean Kelly <sean invisibleduck.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |sean invisibleduck.org
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 08 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3441



--- Comment #1 from Sean Kelly <sean invisibleduck.org> 2010-06-08 10:07:23 PDT
---
Verified as fixed against DMD 2.046.  I'll look at DMD1x as well to be sure.

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