← Back to index
|
Original Bugzilla link
Bug 10130 – map of iota with const step
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-05-21T15:22:00Z
Last change time
2013-06-19T11:20:17Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2013-05-21T15:22:59Z
In this case map!() can't be applied on a iota(): import std.algorithm: map; import std.range: iota; void main() { const step = 2; iota(0, 10, step).map!(i => i); } DMD 2.063beta5 gives: ...\dmd2\src\phobos\std\algorithm.d(482): Error: cannot modify struct result._input Result with immutable members ...\dmd2\src\phobos\std\algorithm.d(390): Error: template instance test.main.MapResult!(__lambda2, Result) error instantiating test.d(5): instantiated from here: map!(Result) test.d(5): Error: template instance test.main.map!(__lambda2).map!(Result) error instantiating
Comment #1
by irritate — 2013-06-18T18:00:49Z
https://github.com/D-Programming-Language/phobos/pull/1354
Comment #2
by github-bugzilla — 2013-06-19T07:07:40Z
Commits pushed to master at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/ebe93db8c19132888169e880ea6ce0db8385acf6
Issue 10130 - Fix compile error when calling map on iota with const step. Also fixed the similar issue for iota with const begin/end/step floats.
https://github.com/D-Programming-Language/phobos/commit/aa4d498466048b422761f8670302aa23dd0703e5
Merge pull request #1354 from irritate/issue_10130 Issue 10130 - Fix compile error when calling map on iota with const step...