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

           Summary: singletons in std.datetime are not created early
                    enough
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: jsan...@gmail.com


--- Comment #0 from Jose Garcia <jsan...@gmail.com> 2011-06-05 22:24:28 PDT ---
When accessing the singletons from a shared static this module ctr, the
singleton have not been instantiated. The following code succeeds when it
shouldn't:

import std.datetime;

shared static this()
{
  assert(UTC() is null);
  assert(LocalTime() is null);
}

A possible solution is:

class Test
{
   shared static this() { _obj = new immutable(shared(Object)); }
   shared static immutable Object _ojb;
}

shared static this()
{
   assert(Test._ojb !is null);
}

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

Reply via email to