Summary: Nested function error in sort with lambda template but
                    not with a lambda
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2012-04-20 17:52:05 PDT ---
import std.algorithm: sort;
int foo(int n)() {
    sort!((a, b) => true)([1]);
    //sort!((int a, int b) => true)([1]);
    return 0;
void main() {

DMD 2.059 shows:

...\dmd2\src\phobos\std\algorithm.d(6781): Error: function!(0).foo.sort!(__lambda3,cast(SwapStrategy)0,int[]).sort is a nested
function and cannot be accessed from!(1).foo

The version that uses the lambda instead of a lambda template compiles
correctly (then crashes at a runtime because the sort function is stupid).

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to