提交 9e35b7ed 编写于 作者: M mcimadamore

7151492: Encapsulate check logic into Attr.ResultInfo

Summary: ResultInfo class should be used to make attribution code transparent w.r.t. check logic being used
Reviewed-by: jjg, dlsmith
上级 000f00c1
......@@ -42,6 +42,7 @@ import com.sun.tools.javac.code.Lint.LintCategory;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.tree.JCTree.*;
import com.sun.tools.javac.code.Type.*;
import com.sun.tools.javac.comp.Check.CheckContext;
import com.sun.source.tree.IdentifierTree;
import com.sun.source.tree.MemberSelectTree;
......@@ -132,6 +133,11 @@ public class Attr extends JCTree.Visitor {
findDiamonds = options.get("findDiamond") != null &&
source.allowDiamond();
useBeforeDeclarationWarning = options.isSet("useBeforeDeclarationWarning");
statInfo = new ResultInfo(NIL, Type.noType);
varInfo = new ResultInfo(VAR, Type.noType);
unknownExprInfo = new ResultInfo(VAL, Type.noType);
unknownTypeInfo = new ResultInfo(TYP, Type.noType);
}
/** Switch: relax some constraints for retrofit mode.
......@@ -204,7 +210,7 @@ public class Attr extends JCTree.Visitor {
Type check(JCTree tree, Type owntype, int ownkind, ResultInfo resultInfo) {
if (owntype.tag != ERROR && resultInfo.pt.tag != METHOD && resultInfo.pt.tag != FORALL) {
if ((ownkind & ~resultInfo.pkind) == 0) {
owntype = chk.checkType(tree.pos(), owntype, resultInfo.pt, errKey);
owntype = resultInfo.check(tree, owntype);
} else {
log.error(tree.pos(), "unexpected.type",
kindNames(resultInfo.pkind),
......@@ -394,20 +400,30 @@ public class Attr extends JCTree.Visitor {
}
}
static class ResultInfo {
class ResultInfo {
int pkind;
Type pt;
CheckContext checkContext;
ResultInfo(int pkind, Type pt) {
this(pkind, pt, chk.basicHandler);
}
protected ResultInfo(int pkind, Type pt, CheckContext checkContext) {
this.pkind = pkind;
this.pt = pt;
this.checkContext = checkContext;
}
protected Type check(DiagnosticPosition pos, Type found) {
return chk.checkType(pos, found, pt, checkContext);
}
}
private final ResultInfo statInfo = new ResultInfo(NIL, Type.noType);
private final ResultInfo varInfo = new ResultInfo(VAR, Type.noType);
private final ResultInfo unknownExprInfo = new ResultInfo(VAL, Type.noType);
private final ResultInfo unknownTypeInfo = new ResultInfo(TYP, Type.noType);
private final ResultInfo statInfo;
private final ResultInfo varInfo;
private final ResultInfo unknownExprInfo;
private final ResultInfo unknownTypeInfo;
Type pt() {
return resultInfo.pt;
......@@ -429,10 +445,6 @@ public class Attr extends JCTree.Visitor {
*/
ResultInfo resultInfo;
/** Visitor argument: the error key to be generated when a type error occurs
*/
String errKey;
/** Visitor result: the computed type.
*/
Type result;
......@@ -445,17 +457,11 @@ public class Attr extends JCTree.Visitor {
* @param resultInfo The result info visitor argument.
*/
private Type attribTree(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) {
return attribTree(tree, env, resultInfo, "incompatible.types");
}
private Type attribTree(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo, String errKey) {
Env<AttrContext> prevEnv = this.env;
ResultInfo prevResult = this.resultInfo;
String prevErrKey = this.errKey;
try {
this.env = env;
this.resultInfo = resultInfo;
this.errKey = errKey;
tree.accept(this);
if (tree == breakTree)
throw new BreakAttr(env);
......@@ -466,18 +472,13 @@ public class Attr extends JCTree.Visitor {
} finally {
this.env = prevEnv;
this.resultInfo = prevResult;
this.errKey = prevErrKey;
}
}
/** Derived visitor method: attribute an expression tree.
*/
public Type attribExpr(JCTree tree, Env<AttrContext> env, Type pt) {
return attribExpr(tree, env, pt, "incompatible.types");
}
public Type attribExpr(JCTree tree, Env<AttrContext> env, Type pt, String key) {
return attribTree(tree, env, new ResultInfo(VAL, pt.tag != ERROR ? pt : Type.noType), key);
return attribTree(tree, env, new ResultInfo(VAL, pt.tag != ERROR ? pt : Type.noType));
}
/** Derived visitor method: attribute an expression tree with
......@@ -1121,9 +1122,16 @@ public class Attr extends JCTree.Visitor {
localEnv;
// Attribute resource declarations
for (JCTree resource : tree.resources) {
CheckContext twrContext = new Check.NestedCheckContext(resultInfo.checkContext) {
@Override
public void report(DiagnosticPosition pos, Type found, Type req, JCDiagnostic details) {
chk.basicHandler.report(pos, found, req, diags.fragment("try.not.applicable.to.type", found));
}
};
ResultInfo twrResult = new ResultInfo(VAL, syms.autoCloseableType, twrContext);
if (resource.hasTag(VARDEF)) {
attribStat(resource, tryEnv);
chk.checkType(resource, resource.type, syms.autoCloseableType, "try.not.applicable.to.type");
twrResult.check(resource, resource.type);
//check that resource type cannot throw InterruptedException
checkAutoCloseable(resource.pos(), localEnv, resource.type);
......@@ -1131,7 +1139,7 @@ public class Attr extends JCTree.Visitor {
VarSymbol var = (VarSymbol)TreeInfo.symbolFor(resource);
var.setData(ElementKind.RESOURCE_VARIABLE);
} else {
attribExpr(resource, tryEnv, syms.autoCloseableType, "try.not.applicable.to.type");
attribTree(resource, tryEnv, twrResult);
}
}
// Attribute body
......@@ -1846,7 +1854,7 @@ public class Attr extends JCTree.Visitor {
}
Type attribDiamond(Env<AttrContext> env,
JCNewClass tree,
final JCNewClass tree,
Type clazztype,
List<Type> argtypes,
List<Type> typeargtypes) {
......@@ -1886,25 +1894,17 @@ public class Attr extends JCTree.Visitor {
clazztype = syms.errType;
}
if (clazztype.tag == FORALL && !pt().isErroneous()) {
//if the resolved constructor's return type has some uninferred
//type-variables, infer them using the expected type and declared
//bounds (JLS 15.12.2.8).
if (clazztype.tag == FORALL && !resultInfo.pt.isErroneous()) {
try {
clazztype = infer.instantiateExpr((ForAll) clazztype,
pt().tag == NONE ? syms.objectType : pt(),
Warner.noWarnings);
clazztype = resultInfo.checkContext.rawInstantiatePoly((ForAll)clazztype, pt(), Warner.noWarnings);
} catch (Infer.InferenceException ex) {
//an error occurred while inferring uninstantiated type-variables
log.error(tree.clazz.pos(),
"cant.apply.diamond.1",
diags.fragment("diamond", clazztype.tsym),
ex.diagnostic);
resultInfo.checkContext.report(tree.clazz.pos(), clazztype, resultInfo.pt,
diags.fragment("cant.apply.diamond.1", diags.fragment("diamond", clazztype.tsym), ex.diagnostic));
}
}
return chk.checkClassType(tree.clazz.pos(),
clazztype,
true);
return chk.checkClassType(tree.clazz.pos(), clazztype, true);
}
/** Make an attributed null check tree.
......
......@@ -269,23 +269,6 @@ public class Check {
else return syms.errType;
}
/** Report a type error.
* @param pos Position to be used for error reporting.
* @param problem A string describing the error.
* @param found The type that was found.
* @param req The type that was required.
*/
Type typeError(DiagnosticPosition pos, Object problem, Type found, Type req) {
log.error(pos, "prob.found.req",
problem, found, req);
return types.createErrorType(found);
}
Type typeError(DiagnosticPosition pos, String problem, Type found, Type req, Object explanation) {
log.error(pos, "prob.found.req.1", problem, found, req, explanation);
return types.createErrorType(found);
}
/** Report an error that wrong type tag was found.
* @param pos Position to be used for error reporting.
* @param required An internationalized string describing the type tag
......@@ -430,6 +413,86 @@ public class Check {
* Type Checking
**************************************************************************/
/**
* A check context is an object that can be used to perform compatibility
* checks - depending on the check context, meaning of 'compatibility' might
* vary significantly.
*/
interface CheckContext {
/**
* 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
*/
void report(DiagnosticPosition pos, Type found, Type req, JCDiagnostic details);
/**
* Obtain a warner for this check context
*/
public Warner checkWarner(DiagnosticPosition pos, Type found, Type req);
}
/**
* This class represent a check context that is nested within another check
* context - useful to check sub-expressions. The default behavior simply
* redirects all method calls to the enclosing check context leveraging
* the forwarding pattern.
*/
static class NestedCheckContext implements CheckContext {
CheckContext enclosingContext;
NestedCheckContext(CheckContext enclosingContext) {
this.enclosingContext = enclosingContext;
}
public boolean compatible(Type found, Type req, Warner warn) {
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);
}
public Warner checkWarner(DiagnosticPosition pos, Type found, Type req) {
return enclosingContext.checkWarner(pos, found, req);
}
}
/**
* Check context to be used when evaluating assignment/return statements
*/
CheckContext basicHandler = new CheckContext() {
public void report(DiagnosticPosition pos, Type found, Type req, JCDiagnostic details) {
if (details == null) {
log.error(pos, "prob.found.req", found, req);
} else {
log.error(pos, "prob.found.req.1", details);
}
}
public boolean compatible(Type found, Type req, Warner warn) {
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);
}
};
/** Check that a given type is assignable to a given proto-type.
* If it is, return the type, otherwise return errType.
* @param pos Position to be used for error reporting.
......@@ -437,64 +500,54 @@ public class Check {
* @param req The type that was required.
*/
Type checkType(DiagnosticPosition pos, Type found, Type req) {
return checkType(pos, found, req, "incompatible.types");
return checkType(pos, found, req, basicHandler);
}
Type checkType(DiagnosticPosition pos, Type found, Type req, String errKey) {
Type checkType(final DiagnosticPosition pos, Type found, Type req, CheckContext checkContext) {
if (req.tag == ERROR)
return req;
if (found.tag == FORALL)
return instantiatePoly(pos, (ForAll)found, req, convertWarner(pos, found, 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 (types.isAssignable(found, req, convertWarner(pos, found, req)))
if (checkContext.compatible(found, req, checkContext.checkWarner(pos, found, req))) {
return found;
if (found.tag <= DOUBLE && req.tag <= DOUBLE)
return typeError(pos, diags.fragment("possible.loss.of.precision"), found, req);
if (found.isSuperBound()) {
log.error(pos, "assignment.from.super-bound", found);
return types.createErrorType(found);
}
if (req.isExtendsBound()) {
log.error(pos, "assignment.to.extends-bound", req);
} else {
if (found.tag <= DOUBLE && req.tag <= DOUBLE) {
checkContext.report(pos, found, req, diags.fragment("possible.loss.of.precision"));
return types.createErrorType(found);
}
checkContext.report(pos, found, req, null);
return types.createErrorType(found);
}
return typeError(pos, diags.fragment(errKey), found, req);
}
/** Instantiate polymorphic type to some prototype, unless
* prototype is `anyPoly' in which case polymorphic type
* is returned unchanged.
*/
Type instantiatePoly(DiagnosticPosition pos, ForAll t, Type pt, Warner warn) throws Infer.NoInstanceException {
if (pt == Infer.anyPoly && complexInference) {
return t;
} else if (pt == Infer.anyPoly || pt.tag == NONE) {
Type newpt = t.qtype.tag <= VOID ? t.qtype : syms.objectType;
return instantiatePoly(pos, t, newpt, warn);
} else if (pt.tag == ERROR) {
return pt;
} else {
try {
return infer.instantiateExpr(t, pt, warn);
} catch (Infer.NoInstanceException ex) {
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) {
JCDiagnostic d = ex.getDiagnostic();
log.error(pos,
"undetermined.type" + (d!=null ? ".1" : ""),
t, d);
return types.createErrorType(pt);
} else {
JCDiagnostic d = ex.getDiagnostic();
return typeError(pos,
diags.fragment("incompatible.types" + (d!=null ? ".1" : ""), d),
t, pt);
d = diags.fragment("undetermined.type", t, d);
}
} catch (Infer.InvalidInstanceException ex) {
JCDiagnostic d = ex.getDiagnostic();
log.error(pos, "invalid.inferred.types", t.tvars, d);
return types.createErrorType(pt);
}
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);
}
}
......@@ -505,15 +558,17 @@ public class Check {
* @param req The target type of the cast.
*/
Type checkCastable(DiagnosticPosition pos, Type found, Type req) {
return checkCastable(pos, found, req, basicHandler);
}
Type checkCastable(DiagnosticPosition pos, Type found, Type req, CheckContext checkContext) {
if (found.tag == FORALL) {
instantiatePoly(pos, (ForAll) found, req, castWarner(pos, found, req));
instantiatePoly(pos, basicHandler, (ForAll) found, req, castWarner(pos, found, req));
return req;
} else if (types.isCastable(found, req, castWarner(pos, found, req))) {
return req;
} else {
return typeError(pos,
diags.fragment("inconvertible.types"),
found, req);
checkContext.report(pos, found, req, diags.fragment("inconvertible.types", found, req));
return types.createErrorType(found);
}
}
......@@ -867,14 +922,6 @@ public class Check {
&& types.isSubtype(actual, types.supertype(formal))
&& types.isSubtypeUnchecked(actual, types.interfaces(formal), warn))
return;
if (false) {
// TODO: make assertConvertible work
typeError(tree.pos(), diags.fragment("incompatible.types"), actual, formal);
throw new AssertionError("Tree: " + tree
+ " actual:" + actual
+ " formal: " + formal);
}
}
/**
......
......@@ -347,7 +347,7 @@ public class Infer {
that.tvars,
instantiateAsUninferredVars(undetvars, that.tvars));
}
return chk.checkType(warn.pos(), that.inst(targs, types), to);
return that.inst(targs, types);
}
//where
private List<Type> instantiateAsUninferredVars(List<Type> undetvars, List<Type> tvars) {
......
......@@ -29,6 +29,8 @@ import com.sun.tools.javac.api.Formattable.LocalizedString;
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Type.*;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.comp.Attr.ResultInfo;
import com.sun.tools.javac.comp.Check.CheckContext;
import com.sun.tools.javac.comp.Resolve.MethodResolutionContext.Candidate;
import com.sun.tools.javac.jvm.*;
import com.sun.tools.javac.tree.*;
......@@ -70,6 +72,7 @@ public class Resolve {
Names names;
Log log;
Symtab syms;
Attr attr;
Check chk;
Infer infer;
ClassReader reader;
......@@ -101,6 +104,7 @@ public class Resolve {
names = Names.instance(context);
log = Log.instance(context);
attr = Attr.instance(context);
chk = Check.instance(context);
infer = Infer.instance(context);
reader = ClassReader.instance(context);
......@@ -627,15 +631,8 @@ public class Resolve {
}
while (argtypes.nonEmpty() && formals.head != varargsFormal) {
Type undetFormal = infer.asUndetType(formals.head, undetvars);
Type capturedActual = types.capture(argtypes.head);
boolean works = allowBoxing ?
types.isConvertible(capturedActual, undetFormal, warn) :
types.isSubtypeUnchecked(capturedActual, undetFormal, warn);
if (!works) {
throw handler.argumentMismatch(false, argtypes.head, formals.head);
}
checkedArgs.append(capturedActual);
ResultInfo resultInfo = methodCheckResult(formals.head, allowBoxing, false, undetvars, handler, warn);
checkedArgs.append(resultInfo.check(env.tree.pos(), argtypes.head));
argtypes = argtypes.tail;
formals = formals.tail;
}
......@@ -648,13 +645,9 @@ public class Resolve {
//note: if applicability check is triggered by most specific test,
//the last argument of a varargs is _not_ an array type (see JLS 15.12.2.5)
Type elt = types.elemtype(varargsFormal);
Type eltUndet = infer.asUndetType(elt, undetvars);
while (argtypes.nonEmpty()) {
Type capturedActual = types.capture(argtypes.head);
if (!types.isConvertible(capturedActual, eltUndet, warn)) {
throw handler.argumentMismatch(true, argtypes.head, elt);
}
checkedArgs.append(capturedActual);
ResultInfo resultInfo = methodCheckResult(elt, allowBoxing, true, undetvars, handler, warn);
checkedArgs.append(resultInfo.check(env.tree.pos(), argtypes.head));
argtypes = argtypes.tail;
}
//check varargs element type accessibility
......@@ -665,39 +658,116 @@ public class Resolve {
}
return checkedArgs.toList();
}
// where
public static class InapplicableMethodException extends RuntimeException {
private static final long serialVersionUID = 0;
JCDiagnostic diagnostic;
JCDiagnostic.Factory diags;
/**
* Check context to be used during method applicability checks. A method check
* context might contain inference variables.
*/
abstract class MethodCheckContext implements CheckContext {
InapplicableMethodException(JCDiagnostic.Factory diags) {
this.diagnostic = null;
this.diags = diags;
}
InapplicableMethodException setMessage() {
this.diagnostic = null;
return this;
}
InapplicableMethodException setMessage(String key) {
this.diagnostic = key != null ? diags.fragment(key) : null;
return this;
}
InapplicableMethodException setMessage(String key, Object... args) {
this.diagnostic = key != null ? diags.fragment(key, args) : null;
return this;
}
InapplicableMethodException setMessage(JCDiagnostic diag) {
this.diagnostic = diag;
return this;
}
MethodCheckHandler handler;
boolean useVarargs;
List<Type> undetvars;
Warner rsWarner;
public JCDiagnostic getDiagnostic() {
return diagnostic;
public MethodCheckContext(MethodCheckHandler handler, boolean useVarargs, List<Type> undetvars, Warner rsWarner) {
this.handler = handler;
this.useVarargs = useVarargs;
this.undetvars = undetvars;
this.rsWarner = rsWarner;
}
public void report(DiagnosticPosition pos, Type found, Type req, JCDiagnostic details) {
throw handler.argumentMismatch(useVarargs, found, req);
}
public Type rawInstantiatePoly(ForAll found, Type req, Warner warn) {
throw new AssertionError("ForAll in argument position");
}
public Warner checkWarner(DiagnosticPosition pos, Type found, Type req) {
return rsWarner;
}
}
/**
* Subclass of method check context class that implements strict method conversion.
* Strict method conversion checks compatibility between types using subtyping tests.
*/
class StrictMethodContext extends MethodCheckContext {
public StrictMethodContext(MethodCheckHandler handler, boolean useVarargs, List<Type> undetvars, Warner rsWarner) {
super(handler, useVarargs, undetvars, rsWarner);
}
public boolean compatible(Type found, Type req, Warner warn) {
return types.isSubtypeUnchecked(found, infer.asUndetType(req, undetvars), warn);
}
}
/**
* Subclass of method check context class that implements loose method conversion.
* Loose method conversion checks compatibility between types using method conversion tests.
*/
class LooseMethodContext extends MethodCheckContext {
public LooseMethodContext(MethodCheckHandler handler, boolean useVarargs, List<Type> undetvars, Warner rsWarner) {
super(handler, useVarargs, undetvars, rsWarner);
}
public boolean compatible(Type found, Type req, Warner warn) {
return types.isConvertible(found, infer.asUndetType(req, undetvars), warn);
}
}
/**
* Create a method check context to be used during method applicability check
*/
ResultInfo methodCheckResult(Type to, boolean allowBoxing, boolean useVarargs,
List<Type> undetvars, MethodCheckHandler methodHandler, Warner rsWarner) {
MethodCheckContext checkContext = allowBoxing ?
new LooseMethodContext(methodHandler, useVarargs, undetvars, rsWarner) :
new StrictMethodContext(methodHandler, useVarargs, undetvars, rsWarner);
return attr.new ResultInfo(VAL, to, checkContext) {
@Override
protected Type check(DiagnosticPosition pos, Type found) {
return super.check(pos, chk.checkNonVoid(pos, types.capture(types.upperBound(found))));
}
};
}
public static class InapplicableMethodException extends RuntimeException {
private static final long serialVersionUID = 0;
JCDiagnostic diagnostic;
JCDiagnostic.Factory diags;
InapplicableMethodException(JCDiagnostic.Factory diags) {
this.diagnostic = null;
this.diags = diags;
}
InapplicableMethodException setMessage() {
this.diagnostic = null;
return this;
}
private final InapplicableMethodException inapplicableMethodException;
InapplicableMethodException setMessage(String key) {
this.diagnostic = key != null ? diags.fragment(key) : null;
return this;
}
InapplicableMethodException setMessage(String key, Object... args) {
this.diagnostic = key != null ? diags.fragment(key, args) : null;
return this;
}
InapplicableMethodException setMessage(JCDiagnostic diag) {
this.diagnostic = diag;
return this;
}
public JCDiagnostic getDiagnostic() {
return diagnostic;
}
}
private final InapplicableMethodException inapplicableMethodException;
/* ***************************************************************************
* Symbol lookup
......
......@@ -134,12 +134,6 @@ compiler.err.array.dimension.missing=\
compiler.err.array.req.but.found=\
array required, but {0} found
compiler.err.assignment.from.super-bound=\
assigning from wildcard {0}
compiler.err.assignment.to.extends-bound=\
assigning to wildcard {0}
compiler.err.attribute.value.must.be.constant=\
attribute value must be constant
......@@ -779,17 +773,10 @@ compiler.err.io.exception=\
compiler.err.undef.label=\
undefined label: {0}
compiler.err.undetermined.type=\
cannot infer type arguments for {0}
# 0: type, 1: message segment
compiler.err.undetermined.type.1=\
cannot infer type arguments for {0};\n\
reason: {1}
# 0: list of type, 1: message segment
compiler.err.invalid.inferred.types=\
invalid inferred types for {0}; {1}
compiler.misc.invalid.inferred.types=\
invalid inferred types for {0}\n\
reason: {1}
# 0: message segment, 1: unused
compiler.err.cant.apply.diamond=\
......@@ -797,7 +784,12 @@ compiler.err.cant.apply.diamond=\
# 0: message segment or type, 1: message segment
compiler.err.cant.apply.diamond.1=\
cannot infer type arguments for {0};\n\
cannot infer type arguments for {0}\n\
reason: {1}
# 0: message segment or type, 1: message segment
compiler.misc.cant.apply.diamond.1=\
cannot infer type arguments for {0}\n\
reason: {1}
compiler.err.unreachable.stmt=\
......@@ -1503,11 +1495,15 @@ compiler.err.not.within.bounds=\
#####
# 0: message segment, 1: type, 2: type
# 0: type, 1: type
compiler.err.prob.found.req=\
{0}\n\
required: {2}\n\
found: {1}
incompatible types\n\
required: {0}\n\
found: {1}
# 0: message segment
compiler.err.prob.found.req.1=\
incompatible types: {0}
# 0: message segment, 1: type, 2: type
compiler.warn.prob.found.req=\
......@@ -1515,22 +1511,9 @@ compiler.warn.prob.found.req=\
required: {2}\n\
found: {1}
compiler.err.prob.found.req.1=\
{0} {3}\n\
required: {2}\n\
found: {1}
## The following are all possible strings for the first argument ({0}) of the
## above strings.
compiler.misc.incompatible.types=\
incompatible types
# 0: message segment
compiler.misc.incompatible.types.1=\
incompatible types; {0}
# 0: type, 1: type
compiler.misc.inconvertible.types=\
inconvertible types
{0} cannot be converted to {1}
compiler.misc.possible.loss.of.precision=\
possible loss of precision
......@@ -1545,19 +1528,15 @@ compiler.misc.unchecked.assign=\
compiler.misc.unchecked.cast.to.type=\
unchecked cast
compiler.misc.assignment.from.super-bound=\
assignment from super-bound type {0}
compiler.misc.assignment.to.extends-bound=\
assignment to extends-bound type {0}
# compiler.err.star.expected=\
# ''*'' expected
# compiler.err.no.elem.type=\
# \[\*\] cannot have a type
# 0: type
compiler.misc.try.not.applicable.to.type=\
try-with-resources not applicable to variable type
try-with-resources not applicable to variable type {0}\n\
(expected a variable of type java.lang.AutoCloseable)
#####
......@@ -1592,8 +1571,11 @@ 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=\
undetermined type
cannot infer type arguments for {0}\n\
reason: {1}
compiler.misc.type.variable.has.undetermined.type=\
type variable {0} has undetermined type
......
TestCast6979683_BAD34.java:34:49: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Number, boolean
TestCast6979683_BAD34.java:34:49: compiler.err.prob.found.req: java.lang.Number, boolean
1 error
TestCast6979683_BAD35.java:35:45: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Number, int
TestCast6979683_BAD35.java:35:45: compiler.err.prob.found.req: java.lang.Number, int
1 error
TestCast6979683_BAD36.java:36:58: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Comparable<java.lang.Integer>, int
TestCast6979683_BAD36.java:36:58: compiler.err.prob.found.req: java.lang.Comparable<java.lang.Integer>, int
1 error
TestCast6979683_BAD37.java:37:61: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), java.lang.Comparable<java.lang.Short>, int
TestCast6979683_BAD37.java:37:61: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: java.lang.Comparable<java.lang.Short>, int)
1 error
TestCast6979683_BAD38.java:38:62: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Comparable<java.lang.Character>, float
TestCast6979683_BAD38.java:38:62: compiler.err.prob.found.req: java.lang.Comparable<java.lang.Character>, float
1 error
TestCast6979683_BAD39.java:39:53: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), java.lang.Number, char
TestCast6979683_BAD39.java:39:53: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: java.lang.Number, char)
1 error
T6722234d.java:18:20: compiler.err.prob.found.req: (compiler.misc.incompatible.types), compiler.misc.intersection.type: 1, T6722234d.A
T6722234d.java:18:20: compiler.err.prob.found.req: compiler.misc.intersection.type: 1, T6722234d.A
- compiler.misc.where.description.intersection: compiler.misc.intersection.type: 1,{(compiler.misc.where.intersection: compiler.misc.intersection.type: 1, java.lang.Object,T6722234d.I1,T6722234d.I2)}
1 error
T6722234d.java:18:20: compiler.err.prob.found.req: (compiler.misc.incompatible.types), compiler.misc.intersection.type: 1, T6722234d.A
T6722234d.java:18:20: compiler.err.prob.found.req: compiler.misc.intersection.type: 1, T6722234d.A
- compiler.misc.where.description.intersection: compiler.misc.intersection.type: 1,{(compiler.misc.where.intersection: compiler.misc.intersection.type: 1, Object,I1,I2)}
1 error
T6400189a.java:14:35: compiler.warn.unchecked.call.mbr.of.raw.type: <T>getAnnotation(java.lang.Class<T>), java.lang.reflect.Constructor
T6400189a.java:14:35: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.annotation.Annotation, java.lang.annotation.Documented
T6400189a.java:14:35: compiler.err.prob.found.req: java.lang.annotation.Annotation, java.lang.annotation.Documented
1 error
1 warning
T6400189b.java:24:24: compiler.warn.unchecked.call.mbr.of.raw.type: <T>m(T6400189b<T>), T6400189b.B
T6400189b.java:24:24: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Object, java.lang.Integer
T6400189b.java:24:24: compiler.err.prob.found.req: java.lang.Object, java.lang.Integer
1 error
1 warning
BadlyTypedLabel1.java:13:14: compiler.err.prob.found.req: (compiler.misc.incompatible.types), int, java.lang.String
BadlyTypedLabel1.java:13:14: compiler.err.prob.found.req: int, java.lang.String
1 error
BadlyTypedLabel2.java:15:14: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.math.RoundingMode, java.lang.String
BadlyTypedLabel2.java:15:14: compiler.err.prob.found.req: java.math.RoundingMode, java.lang.String
1 error
T6326754.java:44:12: compiler.err.name.clash.same.erasure: TestConstructor(T), TestConstructor(K)
T6326754.java:52:17: compiler.err.name.clash.same.erasure: setT(K), setT(T)
T6326754.java:64:18: compiler.err.prob.found.req: (compiler.misc.incompatible.types), T, T
T6326754.java:64:18: compiler.err.prob.found.req: T, T
T6326754.java:70:11: compiler.err.cant.apply.symbol.1: kindname.method, setT, java.lang.Object, compiler.misc.no.args, kindname.class, TestC<T>, (compiler.misc.arg.length.mismatch)
- compiler.note.unchecked.filename: T6326754.java
- compiler.note.unchecked.recompile
......
TwrOnNonResource.java:12:30: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
TwrOnNonResource.java:15:30: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
TwrOnNonResource.java:18:30: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
TwrOnNonResource.java:12:30: compiler.err.prob.found.req.1: (compiler.misc.try.not.applicable.to.type: TwrOnNonResource)
TwrOnNonResource.java:15:30: compiler.err.prob.found.req.1: (compiler.misc.try.not.applicable.to.type: TwrOnNonResource)
TwrOnNonResource.java:18:30: compiler.err.prob.found.req.1: (compiler.misc.try.not.applicable.to.type: TwrOnNonResource)
3 errors
T6270087neg.java:36:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6270087neg.Foo<V>, T6270087neg.Foo<U>
T6270087neg.java:36:29: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6270087neg.Foo<V>, T6270087neg.Foo<U>)
1 error
T6557182.java:12:56: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T, java.lang.Comparable<java.lang.Integer>
T6557182.java:12:56: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T, java.lang.Comparable<java.lang.Integer>)
T6557182.java:16:56: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T, java.lang.Comparable<java.lang.Integer>
1 error
1 warning
T6665356.java:31:55: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.Number>.Inner<java.lang.Long>
T6665356.java:35:58: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? super java.lang.Number>
T6665356.java:39:65: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.Number>.Inner<? super java.lang.Number>
T6665356.java:43:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? extends java.lang.String>.Inner<java.lang.Long>
T6665356.java:47:60: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? extends java.lang.String>
T6665356.java:51:55: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.String>.Inner<java.lang.Long>
T6665356.java:55:58: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? super java.lang.String>
T6665356.java:31:55: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.Number>.Inner<java.lang.Long>)
T6665356.java:35:58: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? super java.lang.Number>)
T6665356.java:39:65: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.Number>.Inner<? super java.lang.Number>)
T6665356.java:43:57: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? extends java.lang.String>.Inner<java.lang.Long>)
T6665356.java:47:60: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? extends java.lang.String>)
T6665356.java:51:55: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.String>.Inner<java.lang.Long>)
T6665356.java:55:58: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? super java.lang.String>)
7 errors
T6795580.java:31:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.Number>.Inner<java.lang.Long>[]
T6795580.java:35:60: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? super java.lang.Number>[]
T6795580.java:39:67: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.Number>.Inner<? super java.lang.Number>[]
T6795580.java:43:59: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? extends java.lang.String>.Inner<java.lang.Long>[]
T6795580.java:47:62: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? extends java.lang.String>[]
T6795580.java:51:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.String>.Inner<java.lang.Long>[]
T6795580.java:55:60: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? super java.lang.String>[]
T6795580.java:31:57: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.Number>.Inner<java.lang.Long>[])
T6795580.java:35:60: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? super java.lang.Number>[])
T6795580.java:39:67: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.Number>.Inner<? super java.lang.Number>[])
T6795580.java:43:59: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? extends java.lang.String>.Inner<java.lang.Long>[])
T6795580.java:47:62: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? extends java.lang.String>[])
T6795580.java:51:57: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.String>.Inner<java.lang.Long>[])
T6795580.java:55:60: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? super java.lang.String>[])
7 errors
T6932571neg.java:39:19: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6932571neg.S, G
T6932571neg.java:39:19: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T6932571neg.S, G)
1 error
T7005095neg.java:13:25: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T7005095pos.FooImpl, T7005095pos.Foo<T>
T7005095neg.java:13:25: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: T7005095pos.FooImpl, T7005095pos.Foo<T>)
1 error
T7005671.java:12:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), byte[], X[]
T7005671.java:13:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), short[], X[]
T7005671.java:14:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), int[], X[]
T7005671.java:15:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), long[], X[]
T7005671.java:16:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), float[], X[]
T7005671.java:17:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), double[], X[]
T7005671.java:18:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), char[], X[]
T7005671.java:19:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), boolean[], X[]
T7005671.java:23:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], byte[]
T7005671.java:24:30: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], short[]
T7005671.java:25:28: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], int[]
T7005671.java:26:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], long[]
T7005671.java:27:30: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], float[]
T7005671.java:28:31: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], double[]
T7005671.java:29:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], char[]
T7005671.java:30:32: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], boolean[]
T7005671.java:12:26: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: byte[], X[])
T7005671.java:13:26: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: short[], X[])
T7005671.java:14:26: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: int[], X[])
T7005671.java:15:26: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: long[], X[])
T7005671.java:16:26: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: float[], X[])
T7005671.java:17:26: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: double[], X[])
T7005671.java:18:26: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: char[], X[])
T7005671.java:19:26: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: boolean[], X[])
T7005671.java:23:29: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: X[], byte[])
T7005671.java:24:30: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: X[], short[])
T7005671.java:25:28: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: X[], int[])
T7005671.java:26:29: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: X[], long[])
T7005671.java:27:30: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: X[], float[])
T7005671.java:28:31: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: X[], double[])
T7005671.java:29:29: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: X[], char[])
T7005671.java:30:32: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: X[], boolean[])
16 errors
compiler.err.already.annotated # internal compiler error?
compiler.err.already.defined.this.unit # seems to be masked by compiler.err.duplicate.class
compiler.err.annotation.value.not.allowable.type # cannot happen: precluded by complete type-specific tests
compiler.err.assignment.from.super-bound # DEAD
compiler.err.assignment.to.extends-bound # DEAD
compiler.err.cant.apply.symbol
compiler.err.cant.read.file # (apt.JavaCompiler?)
compiler.err.cant.select.static.class.from.param.type
......@@ -24,7 +22,6 @@ compiler.err.no.annotation.member
compiler.err.no.encl.instance.of.type.in.scope # cannot occur; always followed by assert false;
compiler.err.no.match.entry # UNUSED?
compiler.err.not.annotation.type # cannot occur given preceding checkType
compiler.err.prob.found.req.1 # Check: DEAD, in unused method
compiler.err.proc.bad.config.file # JavacProcessingEnvironment
compiler.err.proc.cant.access # completion failure
compiler.err.proc.cant.access.1 # completion failure, no stack trace
......@@ -38,12 +35,9 @@ compiler.err.source.cant.overwrite.input.file
compiler.err.stack.sim.error
compiler.err.type.var.more.than.once # UNUSED
compiler.err.type.var.more.than.once.in.result # UNUSED
compiler.err.undetermined.type
compiler.err.unexpected.type
compiler.err.unsupported.cross.fp.lit # Scanner: host system dependent
compiler.err.wrong.target.for.polymorphic.signature.definition # Transitional 292
compiler.misc.assignment.from.super-bound
compiler.misc.assignment.to.extends-bound
compiler.misc.bad.class.file.header # bad class file
compiler.misc.bad.class.signature # bad class file
compiler.misc.bad.const.pool.tag # bad class file
......@@ -88,7 +82,6 @@ compiler.misc.type.req.exact
compiler.misc.type.variable.has.undetermined.type
compiler.misc.unable.to.access.file # ClassFile
compiler.misc.undecl.type.var # ClassReader
compiler.misc.undetermined.type
compiler.misc.unicode.str.not.supported # ClassReader
compiler.misc.verbose.retro # UNUSED
compiler.misc.verbose.retro.with # UNUSED
......
/*
* 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
* 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.cant.apply.diamond.1
// key: compiler.misc.infer.no.conforming.instance.exists
// key: compiler.misc.diamond
class CantApplyDiamond1<X> {
CantApplyDiamond1(CantApplyDiamond1<? super X> lz) { }
void test(CantApplyDiamond1<Integer> li) {
CantApplyDiamond1<String> ls = new CantApplyDiamond1<>(li);
}
}
......@@ -21,9 +21,8 @@
* questions.
*/
// key: compiler.misc.incompatible.types.1
// key: compiler.misc.infer.no.conforming.instance.exists
// key: compiler.err.prob.found.req
// key: compiler.err.prob.found.req.1
class IncompatibleTypes1<V> {
<T extends Integer & Runnable> IncompatibleTypes1<T> m() {
......
......@@ -22,7 +22,7 @@
*/
// key: compiler.misc.inconvertible.types
// key: compiler.err.prob.found.req
// key: compiler.err.prob.found.req.1
class InconvertibleTypes {
class Outer<S> {
......
......@@ -21,7 +21,8 @@
* questions.
*/
// key: compiler.err.invalid.inferred.types
// key: compiler.err.prob.found.req.1
// key: compiler.misc.invalid.inferred.types
// key: compiler.misc.inferred.do.not.conform.to.bounds
import java.util.*;
......
......@@ -22,7 +22,7 @@
*/
// key: compiler.misc.possible.loss.of.precision
// key: compiler.err.prob.found.req
// key: compiler.err.prob.found.req.1
class PossibleLossPrecision {
long l;
......
......@@ -22,7 +22,7 @@
*/
// key: compiler.misc.try.not.applicable.to.type
// key: compiler.err.prob.found.req
// key: compiler.err.prob.found.req.1
class ResourceNotApplicableToType {
void m() {
......
......@@ -21,7 +21,8 @@
* questions.
*/
// key: compiler.err.undetermined.type.1
// key: compiler.err.prob.found.req.1
// key: compiler.misc.undetermined.type
// key: compiler.misc.no.unique.maximal.instance.exists
class UndeterminedType1<V> {
......
......@@ -24,7 +24,6 @@
// key: compiler.misc.where.intersection
// key: compiler.misc.where.description.intersection
// key: compiler.misc.intersection.type
// key: compiler.misc.incompatible.types
// key: compiler.err.prob.found.req
// options: -XDdiags=where
// run: simple
......
T6207386.java:13:30: compiler.err.prob.found.req: (compiler.misc.incompatible.types), X, T6207386.F<? super X>
T6207386.java:13:30: compiler.err.prob.found.req: X, T6207386.F<? super X>
1 error
Neg05.java:19:48: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:19:35: compiler.err.prob.found.req: (compiler.misc.incompatible.types), Neg05.Foo<java.lang.String>, Neg05<?>.Foo<java.lang.String>
Neg05.java:19:35: compiler.err.prob.found.req: Neg05.Foo<java.lang.String>, Neg05<?>.Foo<java.lang.String>
Neg05.java:20:58: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:20:45: compiler.err.prob.found.req: (compiler.misc.incompatible.types), Neg05.Foo<java.lang.String>, Neg05<?>.Foo<? extends java.lang.String>
Neg05.java:20:45: compiler.err.prob.found.req: Neg05.Foo<java.lang.String>, Neg05<?>.Foo<? extends java.lang.String>
Neg05.java:21:43: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:21:30: compiler.err.prob.found.req: (compiler.misc.incompatible.types), Neg05.Foo<java.lang.String>, Neg05<?>.Foo<?>
Neg05.java:21:30: compiler.err.prob.found.req: Neg05.Foo<java.lang.String>, Neg05<?>.Foo<?>
Neg05.java:22:56: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:22:43: compiler.err.prob.found.req: (compiler.misc.incompatible.types), Neg05.Foo<java.lang.String>, Neg05<?>.Foo<? super java.lang.String>
Neg05.java:22:43: compiler.err.prob.found.req: Neg05.Foo<java.lang.String>, Neg05<?>.Foo<? super java.lang.String>
Neg05.java:24:48: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:24:35: compiler.err.prob.found.req: (compiler.misc.incompatible.types), Neg05.Foo<java.lang.String>, Neg05<?>.Foo<java.lang.String>
Neg05.java:24:35: compiler.err.prob.found.req: Neg05.Foo<java.lang.String>, Neg05<?>.Foo<java.lang.String>
Neg05.java:25:58: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:25:45: compiler.err.prob.found.req: (compiler.misc.incompatible.types), Neg05.Foo<java.lang.String>, Neg05<?>.Foo<? extends java.lang.String>
Neg05.java:25:45: compiler.err.prob.found.req: Neg05.Foo<java.lang.String>, Neg05<?>.Foo<? extends java.lang.String>
Neg05.java:26:43: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:26:30: compiler.err.prob.found.req: (compiler.misc.incompatible.types), Neg05.Foo<java.lang.String>, Neg05<?>.Foo<?>
Neg05.java:26:30: compiler.err.prob.found.req: Neg05.Foo<java.lang.String>, Neg05<?>.Foo<?>
Neg05.java:27:56: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:27:43: compiler.err.prob.found.req: (compiler.misc.incompatible.types), Neg05.Foo<java.lang.String>, Neg05<?>.Foo<? super java.lang.String>
Neg05.java:27:43: compiler.err.prob.found.req: Neg05.Foo<java.lang.String>, Neg05<?>.Foo<? super java.lang.String>
Neg05.java:31:37: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:32:47: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:33:32: compiler.err.improperly.formed.type.inner.raw.param
......
Neg06.java:16:37: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: Neg06.CFoo), (compiler.misc.infer.no.conforming.instance.exists: X, Neg06.CFoo<X>, Neg06.CSuperFoo<java.lang.String>)
Neg06.java:16:37: compiler.err.prob.found.req.1: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg06.CFoo), (compiler.misc.infer.no.conforming.instance.exists: X, Neg06.CFoo<X>, Neg06.CSuperFoo<java.lang.String>))
1 error
Neg10.java:16:22: compiler.err.prob.found.req: (compiler.misc.incompatible.types), Neg10.Foo<java.lang.Integer>, Neg10.Foo<java.lang.Number>
Neg10.java:16:22: compiler.err.prob.found.req: Neg10.Foo<java.lang.Integer>, Neg10.Foo<java.lang.Number>
1 error
T6315770.java:16:42: compiler.err.undetermined.type.1: <T>T6315770<T>, (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: (compiler.misc.incompatible.types.1: (compiler.misc.infer.no.conforming.instance.exists: T, T6315770<T>, T6315770<? super java.lang.String>)), <T>T6315770<T>, T6315770<? super java.lang.String>
T6315770.java:16:42: compiler.err.prob.found.req.1: (compiler.misc.undetermined.type: <T>T6315770<T>, (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.infer.no.conforming.instance.exists: T, T6315770<T>, T6315770<? super java.lang.String>)
2 errors
T6638712b.java:14:21: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.infer.no.conforming.instance.exists: T, T, java.lang.String)), <T>T, java.lang.String
T6638712b.java:14:21: compiler.err.prob.found.req.1: (compiler.misc.infer.no.conforming.instance.exists: T, T, java.lang.String)
1 error
T6638712e.java:17:27: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.infer.no.conforming.instance.exists: X, T6638712e.Foo<X,java.lang.String>, T6638712e.Foo<java.lang.Object,java.lang.String>)), <X>T6638712e.Foo<X,java.lang.String>, T6638712e.Foo<java.lang.Object,java.lang.String>
T6638712e.java:17:27: compiler.err.prob.found.req.1: (compiler.misc.infer.no.conforming.instance.exists: X, T6638712e.Foo<X,java.lang.String>, T6638712e.Foo<java.lang.Object,java.lang.String>)
1 error
T6650759m.java:43:36: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.util.List<? super java.lang.Integer>, java.util.List<? super java.lang.String>
T6650759m.java:43:36: compiler.err.prob.found.req: java.util.List<? super java.lang.Integer>, java.util.List<? super java.lang.String>
1 error
T7062745neg.java:16:36: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Object, java.lang.Number
T7062745neg.java:16:36: compiler.err.prob.found.req: java.lang.Object, java.lang.Number
1 error
T6886247_2.java:35:28: compiler.err.prob.found.req: (compiler.misc.incompatible.types), compiler.misc.type.captureof: 1, ?, E
T6886247_2.java:35:28: compiler.err.prob.found.req: compiler.misc.type.captureof: 1, ?, E
1 error
Neg06.java:14:16: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.String, java.lang.Throwable
Neg06.java:14:25: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Integer, java.lang.Throwable
Neg06.java:14:16: compiler.err.prob.found.req: java.lang.String, java.lang.Throwable
Neg06.java:14:25: compiler.err.prob.found.req: java.lang.Integer, java.lang.Throwable
2 errors
Neg07.java:14:56: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Class<compiler.misc.type.captureof: 1, ? extends Neg07.ParentException>, java.lang.Class<? extends Neg07.HasFoo>
Neg07.java:14:56: compiler.err.prob.found.req: java.lang.Class<compiler.misc.type.captureof: 1, ? extends Neg07.ParentException>, java.lang.Class<? extends Neg07.HasFoo>
1 error
CastObjectToPrimitiveTest.java:36:23: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), java.lang.Object, int
CastObjectToPrimitiveTest.java:36:23: compiler.err.prob.found.req.1: (compiler.misc.inconvertible.types: java.lang.Object, int)
1 error
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.invalid.inferred.types: X, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
T6313164.java:15:13: compiler.err.invalid.inferred.types: X, (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))
- compiler.note.unchecked.filename: B.java
- compiler.note.unchecked.recompile
3 errors
T7097436.java:13:20: compiler.warn.varargs.unsafe.use.varargs.param: ls
T7097436.java:14:25: compiler.warn.varargs.unsafe.use.varargs.param: ls
T7097436.java:15:20: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.util.List<java.lang.String>[], java.lang.String
T7097436.java:16:26: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.util.List<java.lang.String>[], java.lang.Integer[]
T7097436.java:15:20: compiler.err.prob.found.req: java.util.List<java.lang.String>[], java.lang.String
T7097436.java:16:26: compiler.err.prob.found.req: java.util.List<java.lang.String>[], java.lang.Integer[]
2 errors
2 warnings
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册