https://d.puremagic.com/issues/show_bug.cgi?id=12186

           Summary: Problems with partially inferred type for immutable
                    lambda argument
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2014-02-16 16:53:07 PST ---
Perhaps this shows a compiler problem:


void main() {
    import std.algorithm: map;
    immutable int[][] mat;
    mat.map!((in r) => 0);              // OK
    mat.map!((const r) => 0);           // OK
    mat.map!((immutable int[] r) => 0); // OK
    mat.map!((immutable r) => 0);       // Error
}



DMD 2.065beta3 gives:

...\dmd2\src\phobos\std\algorithm.d(466,23): Error: template D main.__lambda4
cannot deduce function from argument types !()(immutable(int[])), candidates
are:
test.d(7,14):        test.main.__lambda4
...\dmd2\src\phobos\std\algorithm.d(500,19): Error: template D main.__lambda4
cannot deduce function from argument types !()(immutable(int[])), candidates
are:
test.d(7,14):        test.main.__lambda4
...\dmd2\src\phobos\std\algorithm.d(512,23): Error: template D main.__lambda4
cannot deduce function from argument types !()(immutable(int[])), candidates
are:
test.d(7,14):        test.main.__lambda4

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

Reply via email to