public static PsiType @Nullable [] getArgumentTypes(GrNamedArgument @NotNull [] namedArgs,
                                                      GrExpression @NotNull [] expressions,
                                                      GrClosableBlock @NotNull [] closures,
                                                      boolean nullAsBottom,
                                                      @Nullable GrExpression stopAt) {
    List<PsiType> result = new ArrayList<>();

    if (namedArgs.length > 0) {
      GrNamedArgument context = namedArgs[0];
      result.add(GrMapType.createFromNamedArgs(context, namedArgs));
    }

    for (GrExpression expression : expressions) {
      PsiType type = expression.getType();
      if (expression instanceof GrSpreadArgument) {
        if (type instanceof GrTupleType) {
          result.addAll(((GrTupleType)type).getComponentTypes());
        }
        else {
          return null;
        }
      }
      else {
        if (type == null) {
          result.add(nullAsBottom ? null : TypesUtil.getJavaLangObject(expression));
        }
        else {
          if (stopAt == expression) {
            type = TypeConversionUtil.erasure(type);
          }
          result.add(type);
        }
      }

      if (stopAt == expression) {
        return result.toArray(PsiType.createArray(result.size()));
      }
    }

    for (GrClosableBlock closure : closures) {
      PsiType closureType = closure.getType();
      if (closureType != null) {
        if (stopAt == closure) {
          closureType = TypeConversionUtil.erasure(closureType);
        }
        result.add(notNullizeType(closureType, nullAsBottom, closure));
      }
      if (stopAt == closure) {
        break;
      }
    }

    return result.toArray(PsiType.createArray(result.size()));
  }
public static PsiType @Nullable [] getArgumentTypes(GrNamedArgument @NotNull [] namedArgs,
                                                      GrExpression @NotNull [] expressions,
                                                      GrClosableBlock @NotNull [] closures,
                                                      boolean nullAsBottom,
                                                      @Nullable GrExpression stopAt)