Bug 12177 – inout(Cycle!(string[2])) implicit cast problem

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-02-15T03:32:00Z
Last change time
2014-02-17T23:44:02Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-02-15T03:32:49Z
I think this used to work until recently: void main() { import std.range; foreach (s; recurrence!q{a[n - 1] ~ a[n - 2]}("1", "0")) {} } With DMD 2.065beta3 gives: ..\dmd2\src\phobos\std\range.d(4424,21): Error: cannot implicitly convert expression ((nothrow Cycle!(string[2]) __ctmp1475 = 0; , __ctmp1475).this(*cast(string[2]*)this._ptr, this._index + i)) of type Cycle!(string[2]) to inout(Cycle!(string[2]))
Comment #1 by dlang-bugzilla — 2014-02-15T09:22:51Z
Comment #2 by dlang-bugzilla — 2014-02-16T22:05:11Z
Not sure how I got the above result. I'm getting a different one, and this one makes more sense: https://github.com/D-Programming-Language/phobos/pull/1835
Comment #3 by andrej.mitrovich — 2014-02-17T02:11:50Z
Comment #4 by github-bugzilla — 2014-02-17T22:59:42Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/b770bddcaf4eed175461a0d0b982c76a3ca20f1e Merge pull request #1950 from AndrejMitrovic/Fixup1835 Issue 12177 (regression) - inout(Cycle!(string[2])) implicit cast problem