Bug 9694 – A member struct that has mutable opEquals reports weird error message
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-11T18:09:00Z
Last change time
2013-05-07T14:00:21Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2013-03-11T18:09:34Z
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
Comment #3 by andrej.mitrovich — 2013-03-11T19:24:07Z
Should these types of git-head-only bugs be closed as fixed or worksforme?
Comment #4 by k.hara.pg — 2013-03-11T19:28:42Z
(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.
Comment #5 by andrej.mitrovich — 2013-03-11T19:29:40Z
(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.
Comment #6 by github-bugzilla — 2013-05-07T14:00:21Z