import std.stdio; struct ArrayWrapper(T) { T[] array; alias array this; } void main() { ArrayWrapper!(uint) foo; foo.length = 5; // Works foo[0] = 1; // Works writeln(foo[0]); // Works writeln(foo[$ - 1]); // Error: undefined identifier __dollar writeln(foo[0..2]); // Error: ArrayWrapper!(uint) cannot be sliced with [] }
https://github.com/D-Programming-Language/dmd/commit/7c29678ed254fc5e577b7a341a12de5b58efd4f5