code: private boolean validTemplateTypeOfExpression(Node expr) {
      // The expression must have three children. The templateTypeOf keyword, a
      // templatized type and an index
      if (!checkParameterCount(expr, Keywords.TEMPLATETYPEOF)) {
        return false;
      }
      // The parameter must be a valid type expression
      if (!validTypeTransformationExpression(getCallArgument(expr, 0))) {
        warnInvalidInside(Keywords.TEMPLATETYPEOF.name, expr);
        return false;
      }
      if (!getCallArgument(expr, 1).isNumber()) {
        warnInvalid("index", expr);
        warnInvalidInside(Keywords.TEMPLATETYPEOF.name, expr);
        return false;
      }
      double index = getCallArgument(expr, 1).getDouble();
      if (index < 0 || index % 1 != 0) {
        warnInvalid("index", expr);
        warnInvalidInside(Keywords.TEMPLATETYPEOF.name, expr);
        return false;
      }
      return true;
    }
docs: A template type of expression must be of the form
  templateTypeOf(TTLExp, index)