www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10130] New: map of iota with const step

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10130

           Summary: map of iota with const step
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-05-21 15:22:59 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 21 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10130


irritate <irritate gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |irritate gmail.com


--- Comment #1 from irritate <irritate gmail.com> 2013-06-18 18:00:49 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1354

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 18 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10130



--- Comment #2 from github-bugzilla puremagic.com 2013-06-19 07:07:40 PDT ---
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...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 19 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10130


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 19 2013