https://issues.dlang.org/show_bug.cgi?id=23116
--- Comment #4 from Luís Ferreira <[email protected]> --- Doing fallback of the overload manually can be a workaround for this: ``` int opApply(Dg : int delegate(ref ubyte))(scope Dg dg) { enum attrs = functionAttributes!Dg; alias nonRefDg = SetFunctionAttributes!(int delegate(ubyte), functionLinkage!Dg, attrs); foreach(ubyte i; &this.opApply!(nonRefDg)) // use the correct overload if(auto ret = dg(i)) return ret; return 0; } int opApply(Dg : int delegate(ubyte))(scope Dg dg) { // ... } ``` --
