Kind and type checking of indexed types