Bug 14575 – compile error with std.range.refRange when front/back isn't implicitly convertible from const to mutable

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-11T17:49:00Z
Last change time
2017-07-19T17:43:18Z
Keywords
pull
Assigned to
nobody
Creator
ag0aep6g

Comments

Comment #0 by ag0aep6g — 2015-05-11T17:49:13Z
---- 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.
Comment #1 by ag0aep6g — 2015-05-11T17:54:16Z
Comment #2 by github-bugzilla — 2015-05-12T11:03:37Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/08ea0476a5105c6d70e34defb46a66d6ebd28f47 fix Issue 14575 - compile error with std.range.refRange when front/back isn't implicitly convertible from const to mutable https://github.com/D-Programming-Language/phobos/commit/0a8c30ef8444121d179dae2285e7c0cf1a593111 Merge pull request #3274 from aG0aep6G/14575 fix Issue 14575 - compile error with std.range.refRange when front/ba…
Comment #3 by github-bugzilla — 2017-07-19T17:43:18Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/08ea0476a5105c6d70e34defb46a66d6ebd28f47 fix Issue 14575 - compile error with std.range.refRange when front/back isn't implicitly convertible from const to mutable https://github.com/dlang/phobos/commit/0a8c30ef8444121d179dae2285e7c0cf1a593111 Merge pull request #3274 from aG0aep6G/14575