[Issue 9069] struct literals are treated as lvalues
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Nov 24 05:42:20 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9069
--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2012-11-24 05:42:18 PST ---
(In reply to comment #2)
> It was discussed in the thread on const ref in the dmd-beta group during the
> preparations for releasing 2.060, and I think that it was fixed and then
> unfixed then, but I'm not sure. Regardless, the code here compiles when it
> shouldn't, and that needs to be fixed.
This behavior is introduced in 2.059beta by:
https://github.com/D-Programming-Language/dmd/pull/874
As far as I know, the main purpose was to avoid breaking existing code:
struct S {
bool opEquals(const ref S rhs) { ... }
}
void main() {
S s;
assert(s == S()); // translated to s.opEquals(S())
}
But, I believe the behavior should be *fixed*.
--
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