Comment #0 by dlang-bugzilla — 2017-07-21T09:31:00Z
The example from issue 10478 now compiles, even though it shouldn't:
struct S1
{
int opBinary(string op)(S2 other) { return 3; }
}
struct S2
{
int opBinaryRight(string op)(S1 other) { return 4; }
}
void main()
{
auto x = S1.init + S2.init;
}
The spec on binary operator overloading ( https://dlang.org/spec/operatoroverloading.html#binary ) states:
> It is an error for both to equally match.
Introduced in https://github.com/dlang/dmd/pull/1409.
Comment #1 by razvan.nitu1305 — 2018-11-06T12:23:52Z