www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3295] New: range's "front" property can not be an enum

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

           Summary: range's "front" property can not be an enum
           Product: D
           Version: 2.031
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: 2korden gmail.com


struct SomeInfiniteRange
{
    enum front = 42;    // not allowed
    enum empty = false; // allowed

    void popFront() {}
}

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

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

    private SomeContainer _foo;
}

test.d(21): Error: no property 'opApply' for type 'SomeInfiniteRange'
test.d(21): Error: function expected before (), not __error of type int

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