langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java
changeset 9720 bc06a797f393
parent 8616 5a47f5535883
child 10628 dca7012223bc
equal deleted inserted replaced
9719:29adbf9e4cae 9720:bc06a797f393
   405         if (formals.head != varargsFormal) // not enough args
   405         if (formals.head != varargsFormal) // not enough args
   406             throw unambiguousNoInstanceException.setMessage("infer.arg.length.mismatch");
   406             throw unambiguousNoInstanceException.setMessage("infer.arg.length.mismatch");
   407 
   407 
   408         // for varargs arguments as well
   408         // for varargs arguments as well
   409         if (useVarargs) {
   409         if (useVarargs) {
   410             //note: if applicability check is triggered by most specific test,
   410             Type elemType = types.elemtype(varargsFormal);
   411             //the last argument of a varargs is _not_ an array type (see JLS 15.12.2.5)
       
   412             Type elemType = types.elemtypeOrType(varargsFormal);
       
   413             Type elemUndet = types.subst(elemType, tvars, undetvars);
   411             Type elemUndet = types.subst(elemType, tvars, undetvars);
   414             while (actuals.nonEmpty()) {
   412             while (actuals.nonEmpty()) {
   415                 Type actual = actuals.head.baseType();
   413                 Type actual = actuals.head.baseType();
   416                 Type actualNoCapture = actualsNoCapture.head.baseType();
   414                 Type actualNoCapture = actualsNoCapture.head.baseType();
   417                 if (actual.tag == FORALL)
   415                 if (actual.tag == FORALL)