Created attachment 1261
repro case
Starting with dmd 2.063 it is no longer possible to create user defined types
that behave exactly like build in types when it comes to slice assignment.
Creating a user defined type with a propper slice operator which returns the
slice of an array and then assignen that slice to an array will result in a
warning:
repro.d(20): Warning: explicit element-wise assignment copy[] = (s.opSlice())[]
is better than copy[] = s.opSlice()
The compiler does not seem to recognize the use of the slice operator here
because tha analysis is done after rewriting the slice operator into the call
to opSlice. This is especially anoying in generic code where a workaround like
this has to be used to avoid the warning:
static if(isArray!typeof(a))
copy[] = a[];
else
copy[] = a[][];
See attached repro case.