langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java
changeset 5489 e7af65bf7577
parent 3778 38a70273507b
child 5520 86e4b9a9da40
equal deleted inserted replaced
5322:ac6d66f658cb 5489:e7af65bf7577
   285     }
   285     }
   286 
   286 
   287     /** Instantiate method type `mt' by finding instantiations of
   287     /** Instantiate method type `mt' by finding instantiations of
   288      *  `tvars' so that method can be applied to `argtypes'.
   288      *  `tvars' so that method can be applied to `argtypes'.
   289      */
   289      */
   290     public Type instantiateMethod(List<Type> tvars,
   290     public Type instantiateMethod(final Env<AttrContext> env,
       
   291                                   List<Type> tvars,
   291                                   MethodType mt,
   292                                   MethodType mt,
   292                                   final List<Type> argtypes,
   293                                   final List<Type> argtypes,
   293                                   final boolean allowBoxing,
   294                                   final boolean allowBoxing,
   294                                   final boolean useVarargs,
   295                                   final boolean useVarargs,
   295                                   final Warner warn) throws InferenceException {
   296                                   final Warner warn) throws InferenceException {
   414                       throw invalidInstanceException.setMessage("inferred.do.not.conform.to.params", formals, argtypes);
   415                       throw invalidInstanceException.setMessage("inferred.do.not.conform.to.params", formals, argtypes);
   415                     }
   416                     }
   416                     // check that inferred bounds conform to their bounds
   417                     // check that inferred bounds conform to their bounds
   417                     checkWithinBounds(all_tvars,
   418                     checkWithinBounds(all_tvars,
   418                            types.subst(inferredTypes, tvars, inferred), warn);
   419                            types.subst(inferredTypes, tvars, inferred), warn);
       
   420                     if (useVarargs) {
       
   421                         chk.checkVararg(env.tree.pos(), formals);
       
   422                     }
   419                     return super.inst(inferred, types);
   423                     return super.inst(inferred, types);
   420             }};
   424             }};
   421             return mt2;
   425             return mt2;
   422         }
   426         }
   423         else if (!rs.argumentsAcceptable(capturedArgs, mt.getParameterTypes(), allowBoxing, useVarargs, warn)) {
   427         else if (!rs.argumentsAcceptable(capturedArgs, mt.getParameterTypes(), allowBoxing, useVarargs, warn)) {