docs: @Override
      public ClassNode visitType(TypeContext ctx) {
          if (!asBoolean(ctx)) {
              return ClassHelper.OBJECT_TYPE;
          }
  
          ClassNode classNode = null;
  
          if (asBoolean(ctx.classOrInterfaceType())) {
              ctx.classOrInterfaceType().putNodeMetaData(IS_INSIDE_INSTANCEOF_EXPR, ctx.getNodeMetaData(IS_INSIDE_INSTANCEOF_EXPR));
              classNode = this.visitClassOrInterfaceType(ctx.classOrInterfaceType());
          } else if (asBoolean(ctx.primitiveType())) {
              classNode = this.visitPrimitiveType(ctx.primitiveType());
          }
  
          if (!asBoolean(classNode)) {
              if (VOID_STR.equals(ctx.getText())) { // TODO refine error message for `void`
                  throw createParsingFailedException("void is not allowed here", ctx);
              }
  
              throw createParsingFailedException("Unsupported type: " + ctx.getText(), ctx);
          }
  
          classNode.addAnnotations(this.visitAnnotationsOpt(ctx.annotationsOpt()));
  
          List<List<AnnotationNode>> dimList = this.visitDimsOpt(ctx.dimsOpt());
          if (asBoolean(dimList)) {
              // clear array's generics type info. Groovy's bug? array's generics type will be ignored. e.g. List<String>[]... p
              classNode.setGenericsTypes(null);
              classNode.setUsingGenerics(false);
  
              classNode = this.createArrayType(classNode, dimList);
          }
  
          return configureAST(classNode, ctx);
      }