Bug 11681 – std.datetime.IntervalRange.opAssign with non-ref parameter is required
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-04T01:21:00Z
Last change time
2013-12-13T06:20:00Z
Assigned to
nobody
Creator
electrolysis.jp+d
Comments
Comment #0 by electrolysis.jp+d — 2013-12-04T01:21:08Z
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.
Comment #1 by electrolysis.jp+d — 2013-12-08T08:44:55Z