docs: private MethodType callCheckMethod(
        Warner warner,
        Inliner inliner,
        Object resultInfo,
        List<Type> actualArgTypes,
        MethodSymbol methodSymbol,
        Type site,
        Env<AttrContext> env)
        throws InferException {
      try {
        Method checkMethod;
        checkMethod =
            Resolve.class.getDeclaredMethod(
                "checkMethod",
                Env.class,
                Type.class,
                Symbol.class,
                Class.forName(
                    "com.sun.tools.javac.comp.Attr$ResultInfo"), // ResultInfo is package-private
                List.class,
                List.class,
                Warner.class);
        checkMethod.setAccessible(true);
        return (MethodType)
            checkMethod.invoke(
                Resolve.instance(inliner.getContext()),
                env,
                site,
                methodSymbol,
                resultInfo,
                actualArgTypes,
                /*freeTypeVariables=*/ List.<Type>nil(),
                warner);
      } catch (InvocationTargetException e) {
        if (e.getCause() instanceof Resolve.InapplicableMethodException) {
          throw new InferException(
              ImmutableList.of(
                  ((Resolve.InapplicableMethodException) e.getTargetException()).getDiagnostic()));
        }
        throw new LinkageError(e.getMessage(), e.getCause());
      } catch (ReflectiveOperationException e) {
        throw new LinkageError(e.getMessage(), e);
      }
    }