[Issue 13094] New: Refused implicit supertype conversion of different enums in array literal

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 11 02:12:26 PDT 2014


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: nobody at puremagic.com
          Reporter: bearophile_hugs at 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

--


More information about the Digitalmars-d-bugs mailing list