http://d.puremagic.com/issues/show_bug.cgi?id=4139

           Summary: Forward reference error in front() of iterable struct
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-05-01 12:20:53 PDT ---
This is D2 code:


Foo!(TArray) foo(TArray)(TArray r) { // the usual helper function
    return Foo!(TArray)(r);
}
struct Foo(TArray) {
    TArray arr;
    bool empty() { return !arr.length; }
    void popFront() { arr = arr[1 .. $]; }
    // int front() { return arr[0]; } // OK
    auto front() { return arr[0]; } // line 12
}
void main() {
    foreach (el; foo([10])) {}
}


DMD 2.043 prints:
test.d(12): Error: forward reference to inferred return type of function call
__r1.front()

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

Reply via email to