Summary: cannot foreach structs with copy constructor
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

This code fails to comple with the message "Error: e2ir: cannot cast from void
to A".

struct A
        writeln("B's copy");
    bool empty() {return false;}
    void next() {}
    int head() { return 1; }

void main()
    A a;
    foreach (e; a) {}


Reply via email to