[Issue 11681] New: std.datetime.IntervalRange.opAssign with non-ref parameter is required

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 4 01:21:12 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11681

           Summary: std.datetime.IntervalRange.opAssign with non-ref
                    parameter is required
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: electrolysis.jp+d at gmail.com


--- Comment #0 from e10s <electrolysis.jp+d at gmail.com> 2013-12-04 18:21:08 JST ---
import std.datetime;

void main(){
    auto interval1 = Interval!Date(Date(2013, 1, 1), Date(2013, 1, 4));
    auto interval2 = Interval!Date(Date(2014, 2, 1), Date(2014, 2, 4));

    auto range1 = interval1.fwdRange(a => a + 1.days);
    auto range2 = interval2.fwdRange(a => a + 1.days);

    range1 = range2; // ok
    range1 = range2.save; // compilation error
    // range1 = interval2.fwdRange(a => a + 2.days); // compilation error
}

----

This code causes the following compilation error:

 foo.d(11): Error: function std.datetime.IntervalRange!(Date, cast(Direction)1)
 .IntervalRange.opAssign (ref IntervalRange!(Date, cast(Direction)1) rhs) is
not callable
 using argument types (IntervalRange!(Date, cast(Direction)1))

The same problem will occur in PosInfIntervalRange and NegInfIntervalRange.
Due to this, IntervalRange can't be passed to std.algorithm.map.

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


More information about the Digitalmars-d-bugs mailing list