OK, `is(T S : S[])` is true so `S` will be declared, this is pretty hard to read.
Please declare the ElementType at the top of the function.