Thread overview
[Issue 9694] New: A member struct that has mutable opEquals reports weird error message
Mar 12, 2013
Kenji Hara
Mar 12, 2013
Kenji Hara
Mar 12, 2013
Andrej Mitrovic
Mar 12, 2013
Kenji Hara
Mar 12, 2013
Andrej Mitrovic
March 12, 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@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@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: -------
March 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9694


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

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


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2013-03-11 18:15:49 PDT ---
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: -------
March 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9694



--- Comment #2 from github-bugzilla@puremagic.com 2013-03-11 19:22:31 PDT ---
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 Merge pull request #1741 from 9rnsr/fix9694

[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: -------
March 12, 2013
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


--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-03-11 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: -------
March 12, 2013
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


--- Comment #4 from Kenji Hara <k.hara.pg@gmail.com> 2013-03-11 19:28:42 PDT ---
(In reply to comment #3)
> 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: -------
March 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9694



--- Comment #5 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-03-11 19:29:40 PDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > 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: -------
May 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9694



--- Comment #6 from github-bugzilla@puremagic.com 2013-05-07 14:00:21 PDT ---
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: -------