code: private Symbol findDiamond(Env<AttrContext> env,
                                Type site,
                                List<Type> argtypes,
                                List<Type> typeargtypes,
                                boolean allowBoxing,
                                boolean useVarargs) {
          Symbol bestSoFar = methodNotFound;
          TypeSymbol tsym = site.tsym.isInterface() ? syms.objectType.tsym : site.tsym;
          for (final Symbol sym : tsym.members().getSymbolsByName(names.init)) {
              //- System.out.println(" e " + e.sym);
              if (sym.kind == MTH &&
                  (sym.flags_field & SYNTHETIC) == 0) {
                      List<Type> oldParams = sym.type.hasTag(FORALL) ?
                              ((ForAll)sym.type).tvars :
                              List.nil();
                      Type constrType = new ForAll(site.tsym.type.getTypeArguments().appendList(oldParams),
                                                   types.createMethodTypeWithReturn(sym.type.asMethodType(), site));
                      MethodSymbol newConstr = new MethodSymbol(sym.flags(), names.init, constrType, site.tsym) {
                          @Override
                          public Symbol baseSymbol() {
                              return sym;
                          }
                      };
                      bestSoFar = selectBest(env, site, argtypes, typeargtypes,
                              newConstr,
                              bestSoFar,
                              allowBoxing,
                              useVarargs);
              }
          }
          return bestSoFar;
      }
docs: This method scans all the constructor symbol in a given class scope -
  assuming that the original scope contains a constructor of the kind:
  {@code Foo(X x, Y y)}, where X,Y are class type-variables declared in Foo,
  a method check is executed against the modified constructor type:
  {@code <X,Y>Foo<X,Y>(X x, Y y)}. This is crucial in order to enable diamond
  inference. The inferred return type of the synthetic constructor IS
  the inferred type for the diamond operator.