[Issue 9218] [2.061] Correct signature of struct opCmp no longer accepts enum structs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 28 16:52:50 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9218


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #6 from bearophile_hugs at eml.cc 2012-12-28 16:52:49 PST ---
(In reply to comment #4)
> I haven't been able to open that link.


The code:

struct A
{
    enum zero = A(); // Error: A() is not an lvalue

    int opCmp(const ref A a) const
    //int opCmp(A a)
    {
        return 1;
    }
}
void main()
{
    A a;
    auto b = a > A.zero;
    assert(typeid(a).xopCmp !is null);
}


test.d(3): Error: A() is not an lvalue

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


More information about the Digitalmars-d-bugs mailing list