struct S(T) {
T[1] a;
pure ref T opIndex(size_t i) inout { return a[i]; }
}
void main() {
S!short s;
}
/d952/f855.d(4): Error: cast(short)this.a[i] is not an lvalue /d952/f855.d(8): Error: template instance f855.S!short error instantiating
If in prototype T is ommited like this
pure ref opIndex(size_t i) inout { return a[i]; }
It compiles ok.