https://issues.dlang.org/show_bug.cgi?id=14575
Issue ID: 14575 Summary: compile error with std.range.refRange when front/back isn't implicitly convertible from const to mutable Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: Phobos Assignee: nob...@puremagic.com Reporter: ag0ae...@gmail.com ---- import std.range; struct R { Object front; alias back = front; bool empty = false; void popFront() {empty = true;} alias popBack = popFront; @property R save() {return this;} } static assert(isBidirectionalRange!R); void main() { R r; auto rr = refRange(&r); } ---- /home/test/d/dmd2/linux/bin64/../../src/phobos/std/range/package.d(7668): Error: cannot implicitly convert expression ((*this._range).front) of type const(Object) to object.Object /home/test/d/dmd2/linux/bin64/../../src/phobos/std/range/package.d(7790): Error: cannot implicitly convert expression ((*this._range).front) of type const(Object) to object.Object /home/test/d/dmd2/linux/bin64/../../src/phobos/std/range/package.d(8281): Error: template instance std.range.RefRange!(R) error instantiating test.d(17): instantiated from here: refRange!(R) ---- Pull request incoming. --