www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18552] New: std.datetime.date.Date strips year int argument


          Issue ID: 18552
           Summary: std.datetime.date.Date strips year int argument to
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: feklushkin.denis gmail.com

std.datetime.date.Date accepts int year as argument but silently strips it to

    this(int year, int month, int day)  safe pure
        enforceValid!"months"(cast(Month) month);
        enforceValid!"days"(year, cast(Month) month, day);

        _year  = cast(short) year;
        _month = cast(Month) month;
        _day   = cast(ubyte) day;

It is need to add bounds check or change argument type.

Mar 03 2018