On Monday, 10 December 2018 at 21:16:23 UTC, aliak wrote:
Does this fix your issue?
struct S {
mixin operators ops;
S opBinary(string op, T)(T a) {
alias opBinary = ops.opBinary; // explicitly alias
opBinary in this scope
return opBinary!op(a);
}
}
It does,
On Sunday, 9 December 2018 at 18:36:50 UTC, Dennis wrote:
I'm using Adam's workaround from
https://issues.dlang.org/show_bug.cgi?id=19365, but now I have
endless recursion. Reduced code:
```
mixin template operators() {
S opBinary(string op: "+")(S rhs) {
return rhs;
}
//
On Sunday, 9 December 2018 at 18:36:50 UTC, Dennis wrote:
Does anyone know how to get this working?
I added this to the mixin template:
```
alias mixinOpBinary = opBinary;
```
And called mixinOpBinary instead in the forwarded function. I
think that solved it. I think I'll just file an issue
I'm using Adam's workaround from
https://issues.dlang.org/show_bug.cgi?id=19365, but now I have
endless recursion. Reduced code:
```
mixin template operators() {
S opBinary(string op: "+")(S rhs) {
return rhs;
}
// (A)
auto opBinary(string op, T)(T rhs) if (false) {