expected type not needed in array indexing