https://issues.dlang.org/show_bug.cgi?id=13094

          Issue ID: 13094
           Summary: Refused implicit supertype conversion of different
                    enums in array literal
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nob...@puremagic.com
          Reporter: bearophile_h...@eml.cc

enum A { a }
enum B { b }
struct T { A x; B y; }
void main() {
    T t;
    auto r1 = [int(t.x), int(t.y)]; // OK
    auto r2 = [t.tupleof]; // error
}


Gives with dmd 2.066beta2:

test.d(7,16): Error: cannot implicitly convert expression (t.x) of type A to B

--

Reply via email to