May 01, 2010
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: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@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: -------
August 26, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4139


bearophile_hugs@eml.cc changed:

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


--- Comment #1 from bearophile_hugs@eml.cc 2010-08-26 07:58:48 PDT ---
This bug is missing in dmd 2.048, so I close it.

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