public static void checkAndAddSignature(List<? super GrSignature> list,
                                          PsiType[] args,
                                          int position,
                                          List<? extends GrClosureParameter> params,
                                          PsiType returnType,
                                          @NotNull PsiElement context) {
    final int last = position + args.length;
    if (last > params.size()) return;

    for (int i = position; i < last; i++) {
      final GrClosureParameter p = params.get(i);
      final PsiType type = p.getType();
      if (!isAssignableByConversion(type, args[i - position], context)) return;
    }
    GrClosureParameter[] _p = new GrClosureParameter[params.size() - args.length];
    int j = 0;
    for (int i = 0; i < position; i++) {
      _p[j++] = params.get(i);
    }
    for (int i = position + args.length; i < params.size(); i++) {
      _p[j++] = params.get(i);
    }

    list.add(new GrImmediateClosureSignatureImpl(_p, returnType, _p.length > 0 && _p[_p.length - 1].getType() instanceof PsiArrayType, true));
  }
public static void checkAndAddSignature(List<? super GrSignature> list,
                                          PsiType[] args,
                                          int position,
                                          List<? extends GrClosureParameter> params,
                                          PsiType returnType,
                                          @NotNull PsiElement context)