diff --git a/src/share/classes/com/sun/tools/javac/code/Type.java b/src/share/classes/com/sun/tools/javac/code/Type.java index bb211112bfb531cd9ecc39ef86410aaa94be9f61..a9cda5fe85573fc8c74ee14ee5241da306848a60 100644 --- a/src/share/classes/com/sun/tools/javac/code/Type.java +++ b/src/share/classes/com/sun/tools/javac/code/Type.java @@ -54,7 +54,7 @@ import static com.sun.tools.javac.code.TypeTags.*; * package types (tag: PACKAGE, class: PackageType), * type variables (tag: TYPEVAR, class: TypeVar), * type arguments (tag: WILDCARD, class: WildcardType), - * polymorphic types (tag: FORALL, class: ForAll), + * generic method types (tag: FORALL, class: ForAll), * the error type (tag: ERROR, class: ErrorType). * * @@ -1108,11 +1108,16 @@ public class Type implements PrimitiveType { public boolean isErroneous() { return qtype.isErroneous(); } } + /** + * The type of a generic method type. It consists of a method type and + * a list of method type-parameters that are used within the method + * type. + */ public static class ForAll extends DelegatedType implements ExecutableType { public List tvars; public ForAll(List tvars, Type qtype) { - super(FORALL, qtype); + super(FORALL, (MethodType)qtype); this.tvars = tvars; } @@ -1131,34 +1136,6 @@ public class Type implements PrimitiveType { return qtype.isErroneous(); } - /** - * Replaces this ForAll's typevars with a set of concrete Java types - * and returns the instantiated generic type. Subclasses should override - * in order to check that the list of types is a valid instantiation - * of the ForAll's typevars. - * - * @param actuals list of actual types - * @param types types instance - * @return qtype where all occurrences of tvars are replaced - * by types in actuals - */ - public Type inst(List actuals, Types types) { - return types.subst(qtype, tvars, actuals); - } - - /** - * Get the type-constraints of a given kind for a given type-variable of - * this ForAll type. Subclasses should override in order to return more - * accurate sets of constraints. - * - * @param tv the type-variable for which the constraint is to be retrieved - * @param ck the constraint kind to be retrieved - * @return the list of types specified by the selected constraint - */ - public List undetvars() { - return List.nil(); - } - public Type map(Mapping f) { return f.apply(qtype); } @@ -1168,7 +1145,7 @@ public class Type implements PrimitiveType { } public MethodType asMethodType() { - return qtype.asMethodType(); + return (MethodType)qtype; } public void complete() { diff --git a/src/share/classes/com/sun/tools/javac/comp/Attr.java b/src/share/classes/com/sun/tools/javac/comp/Attr.java index 4ad1f830d76f8f3d359f42a0a8f0239dc2051e6c..bcc4653121e74a84cd18721c55d0e4e2d09aae56 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java @@ -1529,7 +1529,7 @@ public class Attr extends JCTree.Visitor { // ...and check that it is legal in the current context. // (this will also set the tree's type) - Type mpt = newMethTemplate(argtypes, typeargtypes); + Type mpt = newMethodTemplate(resultInfo.pt, argtypes, typeargtypes); checkId(tree.meth, site, sym, localEnv, new ResultInfo(MTH, mpt), tree.varargsElement != null); } @@ -1545,7 +1545,7 @@ public class Attr extends JCTree.Visitor { // ... and attribute the method using as a prototype a methodtype // whose formal argument types is exactly the list of actual // arguments (this will also set the method symbol). - Type mpt = newMethTemplate(argtypes, typeargtypes); + Type mpt = newMethodTemplate(resultInfo.pt, argtypes, typeargtypes); localEnv.info.varArgs = false; Type mtype = attribExpr(tree.meth, localEnv, mpt); @@ -1608,8 +1608,8 @@ public class Attr extends JCTree.Visitor { /** Obtain a method type with given argument types. */ - Type newMethTemplate(List argtypes, List typeargtypes) { - MethodType mt = new MethodType(argtypes, null, null, syms.methodClass); + Type newMethodTemplate(Type restype, List argtypes, List typeargtypes) { + MethodType mt = new MethodType(argtypes, restype, null, syms.methodClass); return (typeargtypes == null) ? mt : (Type)new ForAll(typeargtypes, mt); } @@ -1883,25 +1883,23 @@ public class Attr extends JCTree.Visitor { typeargtypes); if (constructor.kind == MTH) { - clazztype = checkMethod(site, - constructor, - localEnv, - tree.args, - argtypes, - typeargtypes, - localEnv.info.varArgs).getReturnType(); - } else { - clazztype = syms.errType; - } - - if (clazztype.tag == FORALL && !resultInfo.pt.isErroneous()) { try { - clazztype = resultInfo.checkContext.rawInstantiatePoly((ForAll)clazztype, pt(), Warner.noWarnings); - } catch (Infer.InferenceException ex) { + clazztype = rawCheckMethod(site, + constructor, + resultInfo, + localEnv, + tree.args, + argtypes, + typeargtypes, + localEnv.info.varArgs).getReturnType(); + } catch (Resolve.InapplicableMethodException ex) { //an error occurred while inferring uninstantiated type-variables resultInfo.checkContext.report(tree.clazz.pos(), clazztype, resultInfo.pt, diags.fragment("cant.apply.diamond.1", diags.fragment("diamond", clazztype.tsym), ex.diagnostic)); + clazztype = syms.errType; } + } else { + clazztype = syms.errType; } return chk.checkClassType(tree.clazz.pos(), clazztype, true); @@ -2255,15 +2253,6 @@ public class Attr extends JCTree.Visitor { sitesym != null && sitesym.name == names._super; - // If selected expression is polymorphic, strip - // type parameters and remember in env.info.tvars, so that - // they can be added later (in Attr.checkId and Infer.instantiateMethod). - if (tree.selected.type.tag == FORALL) { - ForAll pstype = (ForAll)tree.selected.type; - env.info.tvars = pstype.tvars; - site = tree.selected.type = pstype.qtype; - } - // Determine the symbol represented by the selection. env.info.varArgs = false; Symbol sym = selectSym(tree, sitesym, site, env, resultInfo); @@ -2347,7 +2336,6 @@ public class Attr extends JCTree.Visitor { env.info.selectSuper = selectSuperPrev; result = checkId(tree, site, sym, env, resultInfo, varArgs); - env.info.tvars = List.nil(); } //where /** Determine symbol referenced by a Select expression, @@ -2530,16 +2518,6 @@ public class Attr extends JCTree.Visitor { ? types.memberType(site, sym) : sym.type; - if (env.info.tvars.nonEmpty()) { - Type owntype1 = new ForAll(env.info.tvars, owntype); - for (List l = env.info.tvars; l.nonEmpty(); l = l.tail) - if (!owntype.contains(l.head)) { - log.error(tree.pos(), "undetermined.type", owntype1); - owntype1 = types.createErrorType(owntype1); - } - owntype = owntype1; - } - // If the variable is a constant, record constant value in // computed type. if (v.getConstValue() != null && isStaticReference(tree)) @@ -2551,9 +2529,10 @@ public class Attr extends JCTree.Visitor { break; case MTH: { JCMethodInvocation app = (JCMethodInvocation)env.tree; - owntype = checkMethod(site, sym, env, app.args, - resultInfo.pt.getParameterTypes(), resultInfo.pt.getTypeArguments(), - env.info.varArgs); + owntype = checkMethod(site, sym, + new ResultInfo(VAL, resultInfo.pt.getReturnType(), resultInfo.checkContext), + env, app.args, resultInfo.pt.getParameterTypes(), + resultInfo.pt.getTypeArguments(), env.info.varArgs); break; } case PCK: case ERR: @@ -2692,6 +2671,33 @@ public class Attr extends JCTree.Visitor { **/ public Type checkMethod(Type site, Symbol sym, + ResultInfo resultInfo, + Env env, + final List argtrees, + List argtypes, + List typeargtypes, + boolean useVarargs) { + try { + return rawCheckMethod(site, sym, resultInfo, env, argtrees, argtypes, typeargtypes, useVarargs); + } catch (Resolve.InapplicableMethodException ex) { + String key = ex.getDiagnostic() == null ? + "cant.apply.symbol" : + "cant.apply.symbol.1"; + log.error(env.tree.pos, key, + Kinds.kindName(sym), + sym.name == names.init ? sym.owner.name : sym.name, + rs.methodArguments(sym.type.getParameterTypes()), + rs.methodArguments(argtypes), + Kinds.kindName(sym.owner), + sym.owner.type, + ex.getDiagnostic()); + return types.createErrorType(site); + } + } + + private Type rawCheckMethod(Type site, + Symbol sym, + ResultInfo resultInfo, Env env, final List argtrees, List argtypes, @@ -2717,32 +2723,19 @@ public class Attr extends JCTree.Visitor { // Resolve.instantiate from the symbol's type as well as // any type arguments and value arguments. noteWarner.clear(); - Type owntype = rs.instantiate(env, - site, - sym, - argtypes, - typeargtypes, - true, - useVarargs, - noteWarner); + Type owntype = rs.rawInstantiate(env, + site, + sym, + resultInfo, + argtypes, + typeargtypes, + true, + useVarargs, + noteWarner); boolean unchecked = noteWarner.hasNonSilentLint(LintCategory.UNCHECKED); - // If this fails, something went wrong; we should not have - // found the identifier in the first place. - if (owntype == null) { - if (!pt().isErroneous()) - log.error(env.tree.pos(), - "internal.error.cant.instantiate", - sym, site, - Type.toString(pt().getParameterTypes())); - owntype = types.createErrorType(site); - return types.createErrorType(site); - } else if (owntype.getReturnType().tag == FORALL && !unchecked) { - return owntype; - } else { - return chk.checkMethod(owntype, sym, env, argtrees, argtypes, useVarargs, unchecked); - } + return chk.checkMethod(owntype, sym, env, argtrees, argtypes, useVarargs, unchecked); } /** @@ -2755,7 +2748,7 @@ public class Attr extends JCTree.Visitor { List argtypes, List typeargtypes, boolean useVarargs) { - Type owntype = checkMethod(site, sym, env, argtrees, argtypes, typeargtypes, useVarargs); + Type owntype = checkMethod(site, sym, new ResultInfo(VAL, syms.voidType), env, argtrees, argtypes, typeargtypes, useVarargs); chk.checkType(env.tree.pos(), owntype.getReturnType(), syms.voidType); return owntype; } diff --git a/src/share/classes/com/sun/tools/javac/comp/AttrContext.java b/src/share/classes/com/sun/tools/javac/comp/AttrContext.java index 1589ccbfd80b458fa8641f9b66fd163eacb927e3..15c426ed89f60c09b0ae88347619a88ce5a6d3f7 100644 --- a/src/share/classes/com/sun/tools/javac/comp/AttrContext.java +++ b/src/share/classes/com/sun/tools/javac/comp/AttrContext.java @@ -58,10 +58,6 @@ public class AttrContext { */ boolean varArgs = false; - /** A list of type variables that are all-quantifed in current context. - */ - List tvars = List.nil(); - /** A record of the lint/SuppressWarnings currently in effect */ Lint lint; @@ -80,7 +76,6 @@ public class AttrContext { info.isSelfCall = isSelfCall; info.selectSuper = selectSuper; info.varArgs = varArgs; - info.tvars = tvars; info.lint = lint; info.enclVar = enclVar; return info; diff --git a/src/share/classes/com/sun/tools/javac/comp/Check.java b/src/share/classes/com/sun/tools/javac/comp/Check.java index 96b04c8ce1503f57c1e2ca30c12de187a754b854..ec3aa5c044382d1e46c01e0ac4346d4dc523d6ef 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java @@ -423,10 +423,6 @@ public class Check { * Is type 'found' compatible with type 'req' in given context */ boolean compatible(Type found, Type req, Warner warn); - /** - * Instantiate a ForAll type against a given target type 'req' in given context - */ - Type rawInstantiatePoly(ForAll found, Type req, Warner warn); /** * Report a check error */ @@ -454,10 +450,6 @@ public class Check { return enclosingContext.compatible(found, req, warn); } - public Type rawInstantiatePoly(ForAll found, Type req, Warner warn) { - return enclosingContext.rawInstantiatePoly(found, req, warn); - } - public void report(DiagnosticPosition pos, Type found, Type req, JCDiagnostic details) { enclosingContext.report(pos, found, req, details); } @@ -482,12 +474,6 @@ public class Check { return types.isAssignable(found, req, warn); } - public Type rawInstantiatePoly(ForAll found, Type req, Warner warn) { - if (req.tag == NONE) - req = found.qtype.tag <= VOID ? found.qtype : syms.objectType; - return infer.instantiateExpr(found, req, warn); - } - public Warner checkWarner(DiagnosticPosition pos, Type found, Type req) { return convertWarner(pos, found, req); } @@ -506,11 +492,6 @@ public class Check { Type checkType(final DiagnosticPosition pos, Type found, Type req, CheckContext checkContext) { if (req.tag == ERROR) return req; - if (found.tag == FORALL) { - ForAll fa = (ForAll)found; - Type owntype = instantiatePoly(pos, checkContext, fa, req, checkContext.checkWarner(pos, found, req)); - return checkType(pos, owntype, req, checkContext); - } if (req.tag == NONE) return found; if (checkContext.compatible(found, req, checkContext.checkWarner(pos, found, req))) { @@ -525,32 +506,6 @@ public class Check { } } - /** Instantiate polymorphic type to some prototype, unless - * prototype is `anyPoly' in which case polymorphic type - * is returned unchanged. - */ - Type instantiatePoly(DiagnosticPosition pos, CheckContext checkContext, ForAll t, Type pt, Warner warn) throws Infer.NoInstanceException { - try { - return checkContext.rawInstantiatePoly(t, pt, warn); - } catch (final Infer.NoInstanceException ex) { - JCDiagnostic d = ex.getDiagnostic(); - if (d != null) { - if (ex.isAmbiguous) { - d = diags.fragment("undetermined.type", t, d); - } - } - checkContext.report(pos, t, pt, d); - return types.createErrorType(pt); - } catch (Infer.InvalidInstanceException ex) { - JCDiagnostic d = ex.getDiagnostic(); - if (d != null) { - d = diags.fragment("invalid.inferred.types", t.tvars, d); - } - checkContext.report(pos, t, pt, d); - return types.createErrorType(pt); - } - } - /** Check that a given type can be cast to a given target type. * Return the result of the cast. * @param pos Position to be used for error reporting. @@ -561,10 +516,7 @@ public class Check { return checkCastable(pos, found, req, basicHandler); } Type checkCastable(DiagnosticPosition pos, Type found, Type req, CheckContext checkContext) { - if (found.tag == FORALL) { - instantiatePoly(pos, basicHandler, (ForAll) found, req, castWarner(pos, found, req)); - return req; - } else if (types.isCastable(found, req, castWarner(pos, found, req))) { + if (types.isCastable(found, req, castWarner(pos, found, req))) { return req; } else { checkContext.report(pos, found, req, diags.fragment("inconvertible.types", found, req)); diff --git a/src/share/classes/com/sun/tools/javac/comp/Infer.java b/src/share/classes/com/sun/tools/javac/comp/Infer.java index 41875116da83f944743c93ae92ae27b593f03c97..b58b6f80a3f373c08a645b2781bada49cee386b3 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Infer.java +++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java @@ -214,16 +214,23 @@ public class Infer { * If no instantiation exists, or if several incomparable * best instantiations exist throw a NoInstanceException. */ - public Type instantiateExpr(ForAll that, - Type to, + public List instantiateUninferred(DiagnosticPosition pos, + List undetvars, + List tvars, + MethodType mtype, + Attr.ResultInfo resultInfo, Warner warn) throws InferenceException { - List undetvars = that.undetvars(); - Type qtype1 = types.subst(that.qtype, that.tvars, undetvars); + Type to = resultInfo.pt; + if (to.tag == NONE) { + to = mtype.getReturnType().tag <= VOID ? + mtype.getReturnType() : syms.objectType; + } + Type qtype1 = types.subst(mtype.getReturnType(), tvars, undetvars); if (!types.isSubtype(qtype1, qtype1.tag == UNDETVAR ? types.boxedTypeOrType(to) : to)) { throw unambiguousNoInstanceException .setMessage("infer.no.conforming.instance.exists", - that.tvars, that.qtype, to); + tvars, mtype.getReturnType(), to); } List insttypes; @@ -232,32 +239,32 @@ public class Infer { insttypes = List.nil(); for (Type t : undetvars) { UndetVar uv = (UndetVar)t; - if (uv.inst == null && (uv.eq.nonEmpty() || !Type.containsAny(uv.hibounds, that.tvars))) { + if (uv.inst == null && (uv.eq.nonEmpty() || !Type.containsAny(uv.hibounds, tvars))) { maximizeInst((UndetVar)t, warn); stuck = false; } insttypes = insttypes.append(uv.inst == null ? uv.qtype : uv.inst); } - if (!Type.containsAny(insttypes, that.tvars)) { + if (!Type.containsAny(insttypes, tvars)) { //all variables have been instantiated - exit break; } else if (stuck) { //some variables could not be instantiated because of cycles in //upper bounds - provide a (possibly recursive) default instantiation insttypes = types.subst(insttypes, - that.tvars, - instantiateAsUninferredVars(undetvars, that.tvars)); + tvars, + instantiateAsUninferredVars(undetvars, tvars)); break; } else { //some variables have been instantiated - replace newly instantiated //variables in remaining upper bounds and continue for (Type t : undetvars) { UndetVar uv = (UndetVar)t; - uv.hibounds = types.subst(uv.hibounds, that.tvars, insttypes); + uv.hibounds = types.subst(uv.hibounds, tvars, insttypes); } } } - return that.inst(insttypes, types); + return insttypes; } /** @@ -296,18 +303,19 @@ public class Infer { /** Instantiate method type `mt' by finding instantiations of * `tvars' so that method can be applied to `argtypes'. */ - public Type instantiateMethod(final Env env, + public Type instantiateMethod(Env env, List tvars, MethodType mt, - final Symbol msym, - final List argtypes, - final boolean allowBoxing, - final boolean useVarargs, - final Warner warn) throws InferenceException { + Attr.ResultInfo resultInfo, + Symbol msym, + List argtypes, + boolean allowBoxing, + boolean useVarargs, + Warner warn) throws InferenceException { //-System.err.println("instantiateMethod(" + tvars + ", " + mt + ", " + argtypes + ")"); //DEBUG - final List undetvars = makeUndetvars(tvars); + List undetvars = makeUndetvars(tvars); - final List capturedArgs = + List capturedArgs = rs.checkRawArgumentsAcceptable(env, undetvars, argtypes, mt.getParameterTypes(), allowBoxing, useVarargs, warn, new InferenceCheckHandler(undetvars)); @@ -344,38 +352,23 @@ public class Infer { mt = (MethodType)types.subst(mt, tvars, insttypes.toList()); - if (!restvars.isEmpty()) { - // if there are uninstantiated variables, - // quantify result type with them - final List inferredTypes = insttypes.toList(); - final List all_tvars = tvars; //this is the wrong tvars - return new UninferredMethodType(env.tree.pos(), msym, mt, restvars.toList()) { - @Override - List undetvars() { - return restundet.toList(); - } - @Override - void instantiateReturnType(Type restype, List inferred, Types types) throws NoInstanceException { - Type owntype = new MethodType(types.subst(getParameterTypes(), tvars, inferred), - restype, - types.subst(getThrownTypes(), tvars, inferred), - qtype.tsym); - // check that actuals conform to inferred formals - warn.clear(); - checkArgumentsAcceptable(env, capturedArgs, owntype.getParameterTypes(), allowBoxing, useVarargs, warn); - // check that inferred bounds conform to their bounds - checkWithinBounds(all_tvars, undetvars, - types.subst(inferredTypes, tvars, inferred), warn); - qtype = chk.checkMethod(owntype, msym, env, TreeInfo.args(env.tree), capturedArgs, useVarargs, warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)); - } - }; + if (!restvars.isEmpty() && resultInfo != null) { + List restInferred = + instantiateUninferred(env.tree.pos(), restundet.toList(), restvars.toList(), mt, resultInfo, warn); + checkWithinBounds(tvars, undetvars, + types.subst(insttypes.toList(), restvars.toList(), restInferred), warn); + mt = (MethodType)types.subst(mt, restvars.toList(), restInferred); + if (rs.verboseResolutionMode.contains(VerboseResolutionMode.DEFERRED_INST)) { + log.note(env.tree.pos, "deferred.method.inst", msym, mt, resultInfo.pt); + } } - else { + + if (restvars.isEmpty() || resultInfo != null) { // check that actuals conform to inferred formals checkArgumentsAcceptable(env, capturedArgs, mt.getParameterTypes(), allowBoxing, useVarargs, warn); - // return instantiated version of method type - return mt; } + // return instantiated version of method type + return mt; } //where @@ -404,60 +397,6 @@ public class Infer { } } - /** - * A delegated type representing a partially uninferred method type. - * The return type of a partially uninferred method type is a ForAll - * type - when the return type is instantiated (see Infer.instantiateExpr) - * the underlying method type is also updated. - */ - abstract class UninferredMethodType extends DelegatedType { - - final List tvars; - final Symbol msym; - final DiagnosticPosition pos; - - public UninferredMethodType(DiagnosticPosition pos, Symbol msym, MethodType mtype, List tvars) { - super(METHOD, new MethodType(mtype.argtypes, null, mtype.thrown, mtype.tsym)); - this.tvars = tvars; - this.msym = msym; - this.pos = pos; - asMethodType().restype = new UninferredReturnType(tvars, mtype.restype); - } - - @Override - public MethodType asMethodType() { - return qtype.asMethodType(); - } - - @Override - public Type map(Mapping f) { - return qtype.map(f); - } - - abstract void instantiateReturnType(Type restype, List inferred, Types types); - - abstract List undetvars(); - - class UninferredReturnType extends ForAll { - public UninferredReturnType(List tvars, Type restype) { - super(tvars, restype); - } - @Override - public Type inst(List actuals, Types types) { - Type newRestype = super.inst(actuals, types); - instantiateReturnType(newRestype, actuals, types); - if (rs.verboseResolutionMode.contains(VerboseResolutionMode.DEFERRED_INST)) { - log.note(pos, "deferred.method.inst", msym, UninferredMethodType.this.qtype, newRestype); - } - return UninferredMethodType.this.qtype.getReturnType(); - } - @Override - public List undetvars() { - return UninferredMethodType.this.undetvars(); - } - } - } - private void checkArgumentsAcceptable(Env env, List actuals, List formals, boolean allowBoxing, boolean useVarargs, Warner warn) { try { diff --git a/src/share/classes/com/sun/tools/javac/comp/Resolve.java b/src/share/classes/com/sun/tools/javac/comp/Resolve.java index dc6cc38f6a70ab997e52384426a577e32b7b1ce4..5d2db7114ddfbd7faea6c55ef72c106e335b006e 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java @@ -224,12 +224,8 @@ public class Resolve { JCDiagnostic getVerboseApplicableCandidateDiag(int pos, Symbol sym, Type inst) { JCDiagnostic subDiag = null; - if (inst.getReturnType().tag == FORALL) { - Type diagType = types.createMethodTypeWithReturn(inst.asMethodType(), - ((ForAll)inst.getReturnType()).qtype); - subDiag = diags.fragment("partial.inst.sig", diagType); - } else if (sym.type.tag == FORALL) { - subDiag = diags.fragment("full.inst.sig", inst.asMethodType()); + if (sym.type.tag == FORALL) { + subDiag = diags.fragment("partial.inst.sig", inst); } String key = subDiag == null ? @@ -442,6 +438,7 @@ public class Resolve { Type rawInstantiate(Env env, Type site, Symbol m, + ResultInfo resultInfo, List argtypes, List typeargtypes, boolean allowBoxing, @@ -454,11 +451,7 @@ public class Resolve { // tvars is the list of formal type variables for which type arguments // need to inferred. - List tvars = null; - if (env.info.tvars != null) { - tvars = types.newInstances(env.info.tvars); - mt = types.subst(mt, env.info.tvars, tvars); - } + List tvars = List.nil(); if (typeargtypes == null) typeargtypes = List.nil(); if (mt.tag != FORALL && typeargtypes.nonEmpty()) { // This is not a polymorphic method, but typeargs are supplied @@ -499,6 +492,7 @@ public class Resolve { return infer.instantiateMethod(env, tvars, (MethodType)mt, + resultInfo, m, argtypes, allowBoxing, @@ -515,13 +509,14 @@ public class Resolve { Type instantiate(Env env, Type site, Symbol m, + ResultInfo resultInfo, List argtypes, List typeargtypes, boolean allowBoxing, boolean useVarargs, Warner warn) { try { - return rawInstantiate(env, site, m, argtypes, typeargtypes, + return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes, allowBoxing, useVarargs, warn); } catch (InapplicableMethodException ex) { return null; @@ -937,7 +932,7 @@ public class Resolve { if (!sym.isInheritedIn(site.tsym, types)) return bestSoFar; Assert.check(sym.kind < AMBIGUOUS); try { - Type mt = rawInstantiate(env, site, sym, argtypes, typeargtypes, + Type mt = rawInstantiate(env, site, sym, null, argtypes, typeargtypes, allowBoxing, useVarargs, Warner.noWarnings); if (!operator) currentResolutionContext.addApplicableCandidate(sym, mt); @@ -1071,7 +1066,7 @@ public class Resolve { private boolean signatureMoreSpecific(Env env, Type site, Symbol m1, Symbol m2, boolean allowBoxing, boolean useVarargs) { noteWarner.clear(); Type mtype1 = types.memberType(site, adjustVarargs(m1, m2, useVarargs)); - Type mtype2 = instantiate(env, site, adjustVarargs(m2, m1, useVarargs), + Type mtype2 = instantiate(env, site, adjustVarargs(m2, m1, useVarargs), null, types.lowerBoundArgtypes(mtype1), null, allowBoxing, false, noteWarner); return mtype2 != null && diff --git a/src/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/share/classes/com/sun/tools/javac/resources/compiler.properties index 5ccfb341cf04d95b6b809f80c4f8375ee4c83974..0e9e5ce5c57dd93b78d1659a8eb625703d8c6112 100644 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -419,9 +419,6 @@ compiler.err.incomparable.types=\ compiler.err.int.number.too.large=\ integer number too large: {0} -compiler.err.internal.error.cant.instantiate=\ - internal error; cannot instantiate {0} at {1} to ({2}) - compiler.err.intf.annotation.members.cant.have.params=\ @interface members may not have parameters @@ -783,11 +780,6 @@ compiler.err.io.exception=\ compiler.err.undef.label=\ undefined label: {0} -# 0: list of type, 1: message segment -compiler.misc.invalid.inferred.types=\ - invalid inferred types for {0}\n\ - reason: {1} - # 0: message segment, 1: unused compiler.err.cant.apply.diamond=\ cannot infer type arguments for {0} @@ -1582,11 +1574,6 @@ compiler.misc.type.parameter=\ ## The following are all possible strings for the last argument of all those ## diagnostics whose key ends in ".1" -# 0: type, 1: message segment -compiler.misc.undetermined.type=\ - cannot infer type arguments for {0}\n\ - reason: {1} - # 0: type, 1: list of type compiler.misc.no.unique.maximal.instance.exists=\ no unique maximal instance exists for type variable {0} with upper bounds {1} @@ -1982,10 +1969,6 @@ compiler.misc.not.applicable.method.found=\ #{0} not applicable method found: {1}\n\ ({2}) -# 0: type -compiler.misc.full.inst.sig=\ - fully instantiated to: {0} - # 0: type compiler.misc.partial.inst.sig=\ partially instantiated to: {0} diff --git a/test/tools/javac/6758789/T6758789b.out b/test/tools/javac/6758789/T6758789b.out index 45a828dbd490558e7207ca6a06e61fec7fe8ce58..5393f9add900ab508d58efa7af6eb8f7a7047c1b 100644 --- a/test/tools/javac/6758789/T6758789b.out +++ b/test/tools/javac/6758789/T6758789b.out @@ -1,4 +1,4 @@ -T6758789b.java:16:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo +T6758789b.java:16:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo T6758789b.java:16:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, T6758789a.Foo, T6758789a.Foo, kindname.class, T6758789a - compiler.err.warnings.and.werror 1 error diff --git a/test/tools/javac/diags/examples.not-yet.txt b/test/tools/javac/diags/examples.not-yet.txt index 4576cf40202790341cf5e4a4eaac2e7d37909397..0262f05b424ee1ea66c93634be521c8168b57e60 100644 --- a/test/tools/javac/diags/examples.not-yet.txt +++ b/test/tools/javac/diags/examples.not-yet.txt @@ -5,7 +5,6 @@ compiler.err.cant.apply.symbol compiler.err.cant.read.file # (apt.JavaCompiler?) compiler.err.cant.select.static.class.from.param.type compiler.err.illegal.char.for.encoding -compiler.err.internal.error.cant.instantiate # Attr: should not happen compiler.err.io.exception # (javah.JavahTask?) compiler.err.limit.code # Code compiler.err.limit.code.too.large.for.try.stmt # Gen diff --git a/test/tools/javac/diags/examples/ApplicableMethodFound1.java b/test/tools/javac/diags/examples/ApplicableMethodFound1.java index 7764d50e51843f44e55cd1379ae59503ee6d0a77..a07c3b16001687896aef0a5f5a43ef0ef837f639 100644 --- a/test/tools/javac/diags/examples/ApplicableMethodFound1.java +++ b/test/tools/javac/diags/examples/ApplicableMethodFound1.java @@ -23,7 +23,7 @@ // key: compiler.misc.applicable.method.found.1 // key: compiler.note.verbose.resolve.multi -// key: compiler.misc.full.inst.sig +// key: compiler.misc.partial.inst.sig // options: -XDverboseResolution=applicable,success class ApplicableMethodFound1 { diff --git a/test/tools/javac/diags/examples/CantApplyDiamond1.java b/test/tools/javac/diags/examples/CantApplyDiamond1.java index fdf38e5ce99d54d5d3bda6cc5af39cbeaee882b5..33e2eb7410aea10829f5897a45dd966656723562 100644 --- a/test/tools/javac/diags/examples/CantApplyDiamond1.java +++ b/test/tools/javac/diags/examples/CantApplyDiamond1.java @@ -23,7 +23,7 @@ // key: compiler.err.prob.found.req.1 // key: compiler.misc.cant.apply.diamond.1 -// key: compiler.misc.no.conforming.assignment.exists +// key: compiler.misc.inferred.do.not.conform.to.upper.bounds // key: compiler.misc.diamond class CantApplyDiamond1 { diff --git a/test/tools/javac/diags/examples/FullInstSig.java b/test/tools/javac/diags/examples/FullInstSig.java deleted file mode 100644 index fc0d642b2780f2cae95b3f3ad2d18ebe44e7b95a..0000000000000000000000000000000000000000 --- a/test/tools/javac/diags/examples/FullInstSig.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// key: compiler.misc.applicable.method.found.1 -// key: compiler.note.verbose.resolve.multi -// key: compiler.misc.full.inst.sig -// options: -XDverboseResolution=applicable,success - -class FullInstSig { - - void m(X x) {} - - { m(1); } -} diff --git a/test/tools/javac/diags/examples/IncompatibleTypes1.java b/test/tools/javac/diags/examples/IncompatibleTypes1.java index 0f2b6447f3c42de1c25cb38041456d92ceefe242..7d799270bdcf362035b045a1d10e9470b265395d 100644 --- a/test/tools/javac/diags/examples/IncompatibleTypes1.java +++ b/test/tools/javac/diags/examples/IncompatibleTypes1.java @@ -22,7 +22,7 @@ */ // key: compiler.misc.infer.no.conforming.instance.exists -// key: compiler.err.prob.found.req.1 +// key: compiler.err.cant.apply.symbol.1 class IncompatibleTypes1 { IncompatibleTypes1 m() { diff --git a/test/tools/javac/diags/examples/InferredDoNotConformToLower.java b/test/tools/javac/diags/examples/InferredDoNotConformToLower.java index 4b3430c127a142834b6332855dcaee46e3a3c2d6..ddc257ba11e130dbc2d445a1e63054a0bca58316 100644 --- a/test/tools/javac/diags/examples/InferredDoNotConformToLower.java +++ b/test/tools/javac/diags/examples/InferredDoNotConformToLower.java @@ -21,8 +21,7 @@ * questions. */ -// key: compiler.misc.invalid.inferred.types -// key: compiler.err.prob.found.req.1 +// key: compiler.err.cant.apply.symbol.1 // key: compiler.misc.inferred.do.not.conform.to.lower.bounds import java.util.*; diff --git a/test/tools/javac/diags/examples/InvalidInferredTypes.java b/test/tools/javac/diags/examples/InvalidInferredTypes.java deleted file mode 100644 index fafa25b6ce958cbbc26251de60790c8a5507337f..0000000000000000000000000000000000000000 --- a/test/tools/javac/diags/examples/InvalidInferredTypes.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// key: compiler.err.prob.found.req.1 -// key: compiler.misc.invalid.inferred.types -// key: compiler.misc.inferred.do.not.conform.to.upper.bounds - -import java.util.*; - -class InvalidInferredTypes { - - List m() { return null; } - - void test() { - List li = m(); - } -} diff --git a/test/tools/javac/diags/examples/UndeterminedType1.java b/test/tools/javac/diags/examples/NoUniqueMaximalInstance.java similarity index 77% rename from test/tools/javac/diags/examples/UndeterminedType1.java rename to test/tools/javac/diags/examples/NoUniqueMaximalInstance.java index 598eaa280a6a4885149303e014f7ac3f1211fdb5..38c40226cf31a6733a9aeec425f4c8f03786bdb9 100644 --- a/test/tools/javac/diags/examples/UndeterminedType1.java +++ b/test/tools/javac/diags/examples/NoUniqueMaximalInstance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,15 +21,11 @@ * questions. */ -// key: compiler.err.prob.found.req.1 -// key: compiler.misc.undetermined.type +// key: compiler.err.cant.apply.symbol.1 // key: compiler.misc.no.unique.maximal.instance.exists -class UndeterminedType1 { - UndeterminedType1 m() { - return null; - } +class NoUniqueMaximalInstance { + Z m() { return null; } - - UndeterminedType1 c2 = m(); + { String s = m(); } } diff --git a/test/tools/javac/diags/examples/WhereFreshTvar.java b/test/tools/javac/diags/examples/WhereFreshTvar.java index 6581d170dd81afc9a837eb1ab40d7ec499c1674a..819dbd5609003bdb3fd7a6e5ec59ccffd39c6300 100644 --- a/test/tools/javac/diags/examples/WhereFreshTvar.java +++ b/test/tools/javac/diags/examples/WhereFreshTvar.java @@ -22,10 +22,9 @@ */ // key: compiler.misc.where.fresh.typevar -// key: compiler.misc.where.description.typevar.1 -// key: compiler.misc.where.typevar -// key: compiler.misc.invalid.inferred.types -// key: compiler.err.prob.found.req.1 +// key: compiler.misc.where.description.typevar +// key: compiler.err.cant.apply.symbol.1 +// key: compiler.misc.no.args // key: compiler.misc.inferred.do.not.conform.to.upper.bounds // options: -XDdiags=where,simpleNames // run: simple diff --git a/test/tools/javac/generics/7015430/T7015430.out b/test/tools/javac/generics/7015430/T7015430.out index 269d4840bafd1569b06a02b3dc746b3a65a2a4d0..109bfe7da7f5916600ae0d136b01a88638a3d55a 100644 --- a/test/tools/javac/generics/7015430/T7015430.out +++ b/test/tools/javac/generics/7015430/T7015430.out @@ -1,14 +1,14 @@ -T7015430.java:41:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable +T7015430.java:41:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable T7015430.java:41:14: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430 T7015430.java:50:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable T7015430.java:50:41: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430 -T7015430.java:68:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable +T7015430.java:68:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable T7015430.java:68:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, , java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430 T7015430.java:77:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable T7015430.java:77:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, , java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430 T7015430.java:104:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable T7015430.java:104:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, , java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430 -T7015430.java:113:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable +T7015430.java:113:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable T7015430.java:113:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, , java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430 T7015430.java:41:14: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception T7015430.java:68:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception diff --git a/test/tools/javac/generics/7151802/T7151802.out b/test/tools/javac/generics/7151802/T7151802.out index e2ff30b4c7199a8e151b257743357817d13224aa..94f82828b91203212836e7084580a69257b8a954 100644 --- a/test/tools/javac/generics/7151802/T7151802.out +++ b/test/tools/javac/generics/7151802/T7151802.out @@ -1,5 +1,5 @@ T7151802.java:14:31: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get1, Z, T7151802.Foo, kindname.class, T7151802 -T7151802.java:22:31: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo +T7151802.java:22:31: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo T7151802.java:22:30: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get3, T7151802.Foo, T7151802.Foo, kindname.class, T7151802 T7151802.java:30:36: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get5, compiler.misc.no.args, compiler.misc.no.args, kindname.class, T7151802 T7151802.java:38:32: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo diff --git a/test/tools/javac/generics/inference/6315770/T6315770.out b/test/tools/javac/generics/inference/6315770/T6315770.out index a29bda92b5116e0150ed54094b437eb8b6843bed..a297fdc64fb2308ee1d315d29c491e28a0e858b2 100644 --- a/test/tools/javac/generics/inference/6315770/T6315770.out +++ b/test/tools/javac/generics/inference/6315770/T6315770.out @@ -1,3 +1,3 @@ -T6315770.java:16:42: compiler.err.prob.found.req.1: (compiler.misc.undetermined.type: T6315770, (compiler.misc.no.unique.maximal.instance.exists: T, java.lang.String,java.lang.Integer,java.lang.Runnable)) -T6315770.java:17:40: compiler.err.prob.found.req.1: (compiler.misc.invalid.inferred.types: T, (compiler.misc.inferred.do.not.conform.to.lower.bounds: java.lang.Integer&java.lang.Runnable, java.lang.String)) +T6315770.java:16:42: compiler.err.cant.apply.symbol.1: kindname.method, m, compiler.misc.no.args, compiler.misc.no.args, kindname.class, T6315770, (compiler.misc.no.unique.maximal.instance.exists: T, java.lang.String,java.lang.Integer,java.lang.Runnable) +T6315770.java:17:40: compiler.err.cant.apply.symbol.1: kindname.method, m, compiler.misc.no.args, compiler.misc.no.args, kindname.class, T6315770, (compiler.misc.inferred.do.not.conform.to.lower.bounds: java.lang.Integer&java.lang.Runnable, java.lang.String) 2 errors diff --git a/test/tools/javac/generics/inference/6638712/T6638712b.out b/test/tools/javac/generics/inference/6638712/T6638712b.out index 51cc05c38f92d4fc6fbfe0f644b04c15959da3e8..fcb1dd9c2a40f68031ba250a5fcbc4631278c8d4 100644 --- a/test/tools/javac/generics/inference/6638712/T6638712b.out +++ b/test/tools/javac/generics/inference/6638712/T6638712b.out @@ -1,2 +1,2 @@ -T6638712b.java:14:21: compiler.err.prob.found.req.1: (compiler.misc.invalid.inferred.types: T, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, java.lang.String,java.lang.Object)) +T6638712b.java:14:21: compiler.err.cant.apply.symbol.1: kindname.method, m, I, T6638712b, kindname.class, T6638712b, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, java.lang.String,java.lang.Object) 1 error diff --git a/test/tools/javac/generics/inference/6638712/T6638712e.out b/test/tools/javac/generics/inference/6638712/T6638712e.out index e6c8e2f57b18d62d712d993e5b80a5a3e737f0e1..a02961fe8214775d66cfcdf0e2d2383536bd8595 100644 --- a/test/tools/javac/generics/inference/6638712/T6638712e.out +++ b/test/tools/javac/generics/inference/6638712/T6638712e.out @@ -1,2 +1,2 @@ -T6638712e.java:17:27: compiler.err.prob.found.req.1: (compiler.misc.invalid.inferred.types: X, (compiler.misc.no.conforming.assignment.exists: T6638712e.Foo, T6638712e.Foo)) +T6638712e.java:17:27: compiler.err.cant.apply.symbol.1: kindname.method, m, T6638712e.Foo, T6638712e.Foo, kindname.class, T6638712e.Foo, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Object, java.lang.Boolean,java.lang.Object) 1 error diff --git a/test/tools/javac/generics/inference/6650759/T6650759m.out b/test/tools/javac/generics/inference/6650759/T6650759m.out index e5498de6e574c7b41043b6f6794ed0acf153a027..03d8424c2e0296c3b146e6503262b0e639b35d4b 100644 --- a/test/tools/javac/generics/inference/6650759/T6650759m.out +++ b/test/tools/javac/generics/inference/6650759/T6650759m.out @@ -1,2 +1,2 @@ -T6650759m.java:43:36: compiler.err.prob.found.req.1: (compiler.misc.invalid.inferred.types: Z, (compiler.misc.inferred.do.not.conform.to.lower.bounds: java.lang.Integer, java.lang.String)) +T6650759m.java:43:36: compiler.err.cant.apply.symbol.1: kindname.method, m, java.util.List>, java.util.ArrayList>, kindname.class, T6650759m, (compiler.misc.inferred.do.not.conform.to.lower.bounds: java.lang.Integer, java.lang.String) 1 error diff --git a/test/tools/javac/generics/inference/7154127/T7154127.out b/test/tools/javac/generics/inference/7154127/T7154127.out index 074808ea23cf681b906dd18fd009aa9137a646ba..5637ca12bac507566abd4edad2603e16fa065783 100644 --- a/test/tools/javac/generics/inference/7154127/T7154127.out +++ b/test/tools/javac/generics/inference/7154127/T7154127.out @@ -1,2 +1,2 @@ -T7154127.java:19:49: compiler.err.prob.found.req.1: (compiler.misc.invalid.inferred.types: T,Y,U, (compiler.misc.inferred.do.not.conform.to.upper.bounds: Y, T7154127.D,T7154127.B)) +T7154127.java:19:49: compiler.err.cant.apply.symbol.1: kindname.method, m, compiler.misc.no.args, compiler.misc.no.args, kindname.class, T7154127, (compiler.misc.inferred.do.not.conform.to.upper.bounds: Y, T7154127.D,T7154127.B) 1 error diff --git a/test/tools/javac/varargs/6313164/T6313164.out b/test/tools/javac/varargs/6313164/T6313164.out index 096ad69580783d30fdc9086d13296b042151584c..ea1ba6472397b737ce6e6eadca1521e89c31c7d9 100644 --- a/test/tools/javac/varargs/6313164/T6313164.out +++ b/test/tools/javac/varargs/6313164/T6313164.out @@ -1,6 +1,6 @@ T6313164.java:12:8: compiler.err.cant.apply.symbol.1: kindname.method, foo1, p1.A[], p1.B,p1.B, kindname.class, p1.B, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164) -T6313164.java:14:13: compiler.err.prob.found.req.1: (compiler.misc.invalid.inferred.types: X, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)) -T6313164.java:15:13: compiler.err.prob.found.req.1: (compiler.misc.invalid.inferred.types: X, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)) +T6313164.java:14:13: compiler.err.cant.apply.symbol.1: kindname.method, foo3, X[], compiler.misc.type.null,compiler.misc.type.null, kindname.class, p1.B, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164) +T6313164.java:15:13: compiler.err.cant.apply.symbol.1: kindname.method, foo4, X[], compiler.misc.type.null,compiler.misc.type.null, kindname.class, p1.B, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164) - compiler.note.unchecked.filename: B.java - compiler.note.unchecked.recompile 3 errors