| Thread overview | |||||
|---|---|---|---|---|---|
|
October 14, 2016 [Issue 5609] struct opEquals doesn't conform to language specifications. | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=5609 Andrei Alexandrescu <andrei@erdani.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |bootcamp CC| |andrei@erdani.com -- | ||||
October 14, 2016 [Issue 5609] struct opEquals doesn't conform to language specifications. | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=5609 Andrei Alexandrescu <andrei@erdani.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |bootcamp CC| |andrei@erdani.com -- | ||||
August 15, 2022 [Issue 5609] struct opEquals doesn't conform to language specifications. | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=5609 RazvanN <razvan.nitu1305@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |razvan.nitu1305@gmail.com Resolution|--- |INVALID --- Comment #3 from RazvanN <razvan.nitu1305@gmail.com> --- This bug report highlights a misunderstanding of the spec [1]. It is clearly stated: "Otherwise the expressions a.opEquals(b) and b.opEquals(a) are tried. If both resolve to the same opEquals function, then the expression is rewritten to be a.opEquals(b).". So, in the provided test case a.opEquals(b) and b.opEquals(a) resolve to the same function therefore `a.opEquals(b)` is selected. Only if opEquals did not resolve to the same function the compiler would have tried to semantically analyze the 2 constructions. So this bug report is invalid. [1] https://dlang.org/spec/operatoroverloading.html#equals -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply