Re: Calling function explicitly from mixin template results in recursive call instead

2018-12-10 Thread Dennis via Digitalmars-d-learn
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,

Re: Calling function explicitly from mixin template results in recursive call instead

2018-12-10 Thread aliak via Digitalmars-d-learn
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; } //

Re: Calling function explicitly from mixin template results in recursive call instead

2018-12-10 Thread Dennis via Digitalmars-d-learn
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

Calling function explicitly from mixin template results in recursive call instead

2018-12-09 Thread Dennis via Digitalmars-d-learn
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) {