www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9694] New: A member struct that has mutable opEquals reports weird error message

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: k.hara.pg gmail.com



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: -------
Mar 11 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9694


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/1741

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 11 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9694




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/02800ddf5c42102ebdef8273da28a96db43a3587
fix Issue 9694 - A member struct that has mutable opEquals reports weird error
message

https://github.com/D-Programming-Language/dmd/commit/c8c3ba1f3849d47912822077e8be1a04b46777a3


[REG2.063a] Issue 9694 - A member struct that has mutable opEquals reports
weird error message

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 11 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9694


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



19:24:07 PDT ---
Should these types of git-head-only bugs be closed as fixed or worksforme?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 11 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9694


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




 Should these types of git-head-only bugs be closed as fixed or worksforme?
If no actual test case is added in test suite, select WORKSFORME. Otherwise FIXED. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 11 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9694




19:29:40 PDT ---


 Should these types of git-head-only bugs be closed as fixed or worksforme?
If no actual test case is added in test suite, select WORKSFORME. Otherwise FIXED.
Right, I was just thinking about the changelog. But we can remove this manually from the changelog now, so it's ok. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 11 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9694




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1ae37f347de33871568eaabda33c5ff964e79d12
Improve hasIdentityOpEquals and fix test result of issue 9694.

TypeInfo.equals should throw an Error if the struct doesn't have const objects
equality. For example when the struct has only mutable objects equality.

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