code: private Expression createOfType(Expression target, String functionName, @NotNull cqlParser.FunctionContext ctx) {
          AliasedQuerySource source = enterQueryContext(target);
          try {
              checkArgumentCount(ctx, functionName, 1);
              Expression typeArgument = (Expression)visitor.visit(ctx.paramList().expression(0));
              if (!(typeArgument instanceof Literal)) {
                  throw new IllegalArgumentException("Expected literal argument");
              }
  
              Literal typeLiteral = (Literal)typeArgument;
              if (!(DataTypes.equal(typeLiteral.getResultType(), builder.resolveTypeName("System", "String")))) {
                  throw new IllegalArgumentException("Expected string literal argument");
              }
  
              String typeSpecifier = ((Literal)typeArgument).getValue();
              DataType isType = builder.resolveTypeSpecifier(typeSpecifier);
  
              AliasRef thisRef = of.createAliasRef().withName(source.getAlias());
              boolean isSingular = !(source.getResultType() instanceof ListType);
              DataType elementType = isSingular ? source.getResultType() : ((ListType)source.getResultType()).getElementType();
              thisRef.setResultType(elementType);
  
              Is is = of.createIs().withOperand(thisRef);
              if (isType instanceof NamedType) {
                  is.setIsType(builder.dataTypeToQName(isType));
              }
              else {
                  is.setIsTypeSpecifier(builder.dataTypeToTypeSpecifier(isType));
              }
              is.setResultType(builder.resolveTypeName("System", "Boolean"));
  
              return createQuery(source, null, is, null);
          }
          finally {
              exitQueryContext();
          }
      }
docs: X.ofType(T) === X $this where $this is T