[Issue 10962] Incorrect merging of same enum types with different qualifiers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 22 00:53:57 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=10962


Denis Shelomovskij <verylonglogin.reg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg at gmail.com
            Summary|Wrong implicit conversion   |Incorrect merging of same
                   |of enum in const function   |enum types with different
                   |                            |qualifiers


--- Comment #2 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-12-22 12:53:52 MSK ---
Reduced testcase (the issue has nothing to do with `const` functions):

This code should compile:
---
enum E { a }

void main()
{
    const E ce;
    auto x = 1 ? ce : E.a;
    E e = x;                                 // line 7
    static assert(is(typeof(x) == const E)); // line 8
}
---
main.d(7): Error: cannot implicitly convert expression (x) of type int to E
main.d(8): Error: static assert  (is(int == const(E))) is false
---

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


More information about the Digitalmars-d-bugs mailing list