You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have 2 mixin templates that both overload the same operator, you can't use alias declarations to combine overloads.
Tested on dmd-2.076.1 and dmd-2.073.2
```mixin template A() { auto opBinary(string op, T)(T other) if (op == "in") { return other; }}mixin template B() { auto opBinary(string op, T)(T other) if (op == "&") { return other; }}mixin template C() { mixin A a; mixin B b; alias opBinary = a.opBinary; alias opBinary = b.opBinary;}struct Foo { mixin A a; mixin B b; alias opBinary = a.opBinary; alias opBinary = b.opBinary;}struct Bar { mixin C;}struct TestA { mixin A;}struct TestB { mixin B;}void main() { // These examples work auto test1 = Foo().opBinary!"in"("foo"); auto test2 = Foo().opBinary!"&"("foo"); auto testa = TestA() in "foo"; auto testb = TestB() & "foo"; // These fail to compile auto test4 = Foo() in "foo"; auto test5 = Foo() & "foo"; auto test6 = Bar() in "bar"; auto test7 = Bar() & "bar";}```
The text was updated successfully, but these errors were encountered:
Benjamin Schaaf reported this on 2017-12-24T12:13:04Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=18118
Description
The text was updated successfully, but these errors were encountered: