Reports invalid index and slice expressions.