[Issue 9694] New: A member struct that has mutable opEquals reports weird error message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 11 18:09:37 PDT 2013


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

           Summary: A member struct that has mutable opEquals reports
                    weird error message
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-03-11 18:09:34 PDT ---
This code should work, but instead reports weird error.

struct S
{
    bool opEquals(ref S rhs)
    {
        assert(0);
    }
}
struct T
{
    S s;
}
void main()
{
    T t;
    assert(typeid(T).equals(&t, &t));
}

output:
test.d(9): Error: mutable method test.S.opEquals is not callable using a const
object

This is a regression introduced this commit:
https://github.com/D-Programming-Language/dmd/commit/c63a0a1f864bdcf4cb2fcbee9428e9a35d821c43

-- 
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