@Nullable
  public static <Arg> MapResultWithError mapSimpleSignatureWithErrors(@NotNull GrSignature signature,
                                                                      Arg @NotNull [] args,
                                                                      @NotNull Function<? super Arg, ? extends PsiType> typeComputer,
                                                                      @NotNull GroovyPsiElement context,
                                                                      int maxErrorCount) {
    final GrClosureParameter[] params = signature.getParameters();
    if (args.length < params.length) return null;

    if (args.length > params.length && !signature.isVarargs()) return null;

    int errorCount = 0;
    List<Pair<Integer, PsiType>> errors = new ArrayList<>(maxErrorCount);

    for (int i = 0; i < params.length; i++) {
      final PsiType type = typeComputer.fun(args[i]);
      final GrClosureParameter parameter = params[i];
      final PsiType parameterType = parameter.getType();
      if (isAssignableByConversion(parameterType, type, context)) continue;
      if (parameterType instanceof PsiArrayType && i == params.length - 1) {
        if (i + 1 == args.length) {
          errors.add(new Pair<>(i, parameterType));
        }
        final PsiType ellipsis = ((PsiArrayType)parameterType).getComponentType();
        for (int j = i; j < args.length; j++) {
          if (!isAssignableByConversion(ellipsis, typeComputer.fun(args[j]), context)) {
            errorCount++;
            if (errorCount > maxErrorCount) return null;
            errors.add(new Pair<>(i, ellipsis));
          }
        }
      }
      else {
        errorCount++;
        if (errorCount > maxErrorCount) return null;
        errors.add(new Pair<>(i, parameterType));
      }
    }
    return new MapResultWithError(errors);
  }
@Nullable
  public static <Arg> MapResultWithError mapSimpleSignatureWithErrors(@NotNull GrSignature signature,
                                                                      Arg @NotNull [] args,
                                                                      @NotNull Function<? super Arg, ? extends PsiType> typeComputer,
                                                                      @NotNull GroovyPsiElement context,
                                                                      int maxErrorCount)