On 8/10/16 5:14 PM, ag0aep6g wrote:
On 08/10/2016 10:54 PM, Steven Schveighoffer wrote:
The issue is that it tries using [] on the item to see if it defines a
range-like thing. Since you don't define opSlice(), it automatically
goes to the subrange.
This breaks for int[] as well as Array.
If I add opSlice to your code (and return this) it works.
This is definitely a bug, it should try range functions before opSlice.
Please file.
Related:
https://issues.dlang.org/show_bug.cgi?id=14619
That's the same issue. Thanks. Your case is even worse, because calling
save could be unnecessary and costly.
Note that the compiler will turn this:
foreach(...; foo[]) into this: foreach(...; foo[][])
ugly...
-Steve