[Issue 6631] New: core.time module constructor runs AFTER main program's module constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 8 17:30:45 PDT 2011


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

           Summary: core.time module constructor runs AFTER main program's
                    module constructor
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: thecybershadow at gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2011-09-08 17:30:31 PDT ---
(This might be a DMD bug)

import core.time;
static this()
{
    assert(TickDuration.ticksPerSec != 0);
}
void main() {}

The above will fail, because the core.time module constructor will not have ran
when the check is performed. The assert will pass if moved inside main().

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


More information about the Digitalmars-d-bugs mailing list