code: private boolean validTypeExpression(Node expr) {
      String name = getCallName(expr);
      Keywords keyword = nameToKeyword(name);
      switch (keyword) {
        case TYPE:
          return validTemplateTypeExpression(expr);
        case UNION:
          return validUnionTypeExpression(expr);
        case NONE:
          return validNoneTypeExpression(expr);
        case ALL:
          return validAllTypeExpression(expr);
        case UNKNOWN:
          return validUnknownTypeExpression(expr);
        case RAWTYPEOF:
          return validRawTypeOfTypeExpression(expr);
        case TEMPLATETYPEOF:
          return validTemplateTypeOfExpression(expr);
        case RECORD:
          return validRecordTypeExpression(expr);
        case TYPEEXPR:
          return validNativeTypeExpr(expr);
        default:
          throw new IllegalStateException("Invalid type expression");
      }
    }
docs: A TTL type expression must be a union type, a template type, a record type
  or any of the type predicates (none, rawTypeOf, templateTypeOf).