struct X
{
static int opSlice(size_t a, size_t b)
{
return 42;
}
}
static assert ( X[1..2] == 42 );
// Error: cannot slice type 'X'
-------------------------------------------
There is not reason why slicing should be prohibited in this case. It conforms usual operator syntax rewrite rules and has no grammar ambiguity with array types if slicing bounds are used.