[Issue 9133] New: std.datetime: Cannot implicitly convert const(SysTime) to SysTime

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 10 01:38:40 PST 2012


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

           Summary: std.datetime: Cannot implicitly convert const(SysTime)
                    to SysTime
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bugzilla at kyllingen.net


--- Comment #0 from Lars T. Kyllingstad <bugzilla at kyllingen.net> 2012-12-10 01:38:37 PST ---
Test case:

    import std.datetime;
    const SysTime a;
    SysTime b = a;

Error: cannot implicitly convert expression (a) of type const(SysTime) to
SysTime

This is extremely surprising to me, as I would expect SysTime to have value
semantics.  I suppose this has to do with the timezone field?

If this problem is unavoidable, I think that SysTime should either have a
copy/dup method, or at the very least it should be noted in the documentation
whether it is safe to cast it to mutable.

-- 
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