www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12506] New: Wrongly private lambda to define global immutable array

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

           Summary: Wrongly private lambda to define global immutable
                    array
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



A problem found by ketmar:


import std.range: iota;
import std.algorithm: map;
import std.array: array;
private bool[9] a = 9.iota.map!(i => true).array; // OK
private immutable bool[9] b = 9.iota.map!(i => true).array; // error
void main() {}


DMD 2.066alpha gives:

...\dmd2\src\phobos\std\algorithm.d(512,19): Error: function test.__lambda8 is
not accessible from module algorithm
...\dmd2\src\phobos\std\array.d(29,5): Error: template instance
std.traits.isIterable!(MapResult!(__lambda8, Result)) error instantiating
test.d(5,53):        instantiated from here: array!(MapResult!(__lambda8,
Result))

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 02 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12506


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
           Platform|x86                         |All
         OS/Version|Windows                     |All



https://github.com/D-Programming-Language/dmd/pull/3419

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2014