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

           Summary: forward reference to inferred return type of function
                    call
           Product: D
           Version: 2.031
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: 2kor...@gmail.com


module Test;

struct SomeInfiniteRange
{
    int front() { return 42; }
    enum empty = false;

    void popFront() {}
}

struct SomeContainer(T)
{
    auto opSlice()
    {
        return SomeInfiniteRange();
    }
}

class Test
{
    void test()
    {
        foreach (int f; _foo[]) {
            // do nothing
        }
    }

    private SomeContainer!(int) _foo;
}

Test.d(23): Error: forward reference to inferred return type of function call
this._foo.opSlice()
Test.d(23): Error: foreach: int is not an aggregate type

Note that the code compiles just fine if SomeContainer is a concrete struct
(not a template)

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

Reply via email to