[Issue 13024] Refused implicit supertype conversion of different enums in array literal

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 11 00:58:22 PDT 2014


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

bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice, pull                   |rejects-valid
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---
            Summary|[ICE](expression.c line     |Refused implicit supertype
                   |1172) with implicit         |conversion of different
                   |supertype conversion of     |enums in array literal
                   |different enums in array    |
                   |literal                     |

--- Comment #4 from bearophile_hugs at eml.cc ---
Reopened, because as explained both here and in the pull request, the pull
request fixes only part of the bug. Now this code:


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

Changed the issue name a little because now it's not an ICE, it's a
rejects-valid.

--


More information about the Digitalmars-d-bugs mailing list