提交 80ef4f44 编写于 作者: M mcimadamore

6968793: issues with diagnostics

Summary: several diagnostic improvements
Reviewed-by: jjg
上级 193665c0
......@@ -905,7 +905,10 @@ public class Attr extends JCTree.Visitor {
// or perhaps expr implements Iterable<T>?
Type base = types.asSuper(exprType, syms.iterableType.tsym);
if (base == null) {
log.error(tree.expr.pos(), "foreach.not.applicable.to.type");
log.error(tree.expr.pos(),
"foreach.not.applicable.to.type",
exprType,
diags.fragment("type.req.array.or.iterable"));
elemtype = types.createErrorType(exprType);
} else {
List<Type> iterableParams = base.allparams();
......@@ -970,7 +973,7 @@ public class Attr extends JCTree.Visitor {
if (enumSwitch) {
Symbol sym = enumConstant(c.pat, seltype);
if (sym == null) {
log.error(c.pat.pos(), "enum.const.req");
log.error(c.pat.pos(), "enum.label.must.be.unqualified.enum");
} else if (!labels.add(sym)) {
log.error(c.pos(), "duplicate.case.label");
}
......@@ -2228,10 +2231,10 @@ public class Attr extends JCTree.Visitor {
// Determine the symbol represented by the selection.
env.info.varArgs = false;
Symbol sym = selectSym(tree, site, env, pt, pkind);
Symbol sym = selectSym(tree, sitesym, site, env, pt, pkind);
if (sym.exists() && !isType(sym) && (pkind & (PCK | TYP)) != 0) {
site = capture(site);
sym = selectSym(tree, site, env, pt, pkind);
sym = selectSym(tree, sitesym, site, env, pt, pkind);
}
boolean varArgs = env.info.varArgs;
tree.sym = sym;
......@@ -2320,6 +2323,14 @@ public class Attr extends JCTree.Visitor {
* @param pkind The expected kind(s) of the Select expression.
*/
private Symbol selectSym(JCFieldAccess tree,
Type site,
Env<AttrContext> env,
Type pt,
int pkind) {
return selectSym(tree, site.tsym, site, env, pt, pkind);
}
private Symbol selectSym(JCFieldAccess tree,
Symbol location,
Type site,
Env<AttrContext> env,
Type pt,
......@@ -2331,12 +2342,12 @@ public class Attr extends JCTree.Visitor {
case PACKAGE:
return rs.access(
rs.findIdentInPackage(env, site.tsym, name, pkind),
pos, site, name, true);
pos, location, site, name, true);
case ARRAY:
case CLASS:
if (pt.tag == METHOD || pt.tag == FORALL) {
return rs.resolveQualifiedMethod(
pos, env, site, name, pt.getParameterTypes(), pt.getTypeArguments());
pos, env, location, site, name, pt.getParameterTypes(), pt.getTypeArguments());
} else if (name == names._this || name == names._super) {
return rs.resolveSelf(pos, env, site.tsym, name);
} else if (name == names._class) {
......@@ -2353,7 +2364,7 @@ public class Attr extends JCTree.Visitor {
// We are seeing a plain identifier as selector.
Symbol sym = rs.findIdentInType(env, site, name, pkind);
if ((pkind & ERRONEOUS) == 0)
sym = rs.access(sym, pos, site, name, true);
sym = rs.access(sym, pos, location, site, name, true);
return sym;
}
case WILDCARD:
......@@ -2361,12 +2372,12 @@ public class Attr extends JCTree.Visitor {
case TYPEVAR:
// Normally, site.getUpperBound() shouldn't be null.
// It should only happen during memberEnter/attribBase
// when determining the super type which *must* be
// when determining the super type which *must* beac
// done before attributing the type variables. In
// other words, we are seeing this illegal program:
// class B<T> extends A<T.foo> {}
Symbol sym = (site.getUpperBound() != null)
? selectSym(tree, capture(site.getUpperBound()), env, pt, pkind)
? selectSym(tree, location, capture(site.getUpperBound()), env, pt, pkind)
: null;
if (sym == null) {
log.error(pos, "type.var.cant.be.deref");
......@@ -2375,7 +2386,7 @@ public class Attr extends JCTree.Visitor {
Symbol sym2 = (sym.flags() & Flags.PRIVATE) != 0 ?
rs.new AccessError(env, site, sym) :
sym;
rs.access(sym2, pos, site, name, true);
rs.access(sym2, pos, location, site, name, true);
return sym;
}
case ERROR:
......
......@@ -1042,10 +1042,13 @@ public class Check {
if (incompatibleArg != null) {
for (JCTree arg : tree.arguments) {
if (arg.type == incompatibleArg) {
log.error(arg, "not.within.bounds", incompatibleArg);
log.error(arg, "not.within.bounds", incompatibleArg, forms.head);
}
}
}
forms = forms.tail;
}
}
forms = tree.type.tsym.type.getTypeArguments();
boolean is_java_lang_Class = tree.type.tsym.flatName() == names.java_lang_Class;
......
......@@ -984,7 +984,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
c.owner.kind == PCK && c.owner != syms.unnamedPackage &&
reader.packageExists(c.fullname))
{
log.error(tree.pos, "clash.with.pkg.of.same.name", c);
log.error(tree.pos, "clash.with.pkg.of.same.name", Kinds.kindName(sym), c);
}
} catch (CompletionFailure ex) {
......
......@@ -1236,6 +1236,7 @@ public class Resolve {
*/
Symbol access(Symbol sym,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
boolean qualified,
......@@ -1246,25 +1247,48 @@ public class Resolve {
if (!site.isErroneous() &&
!Type.isErroneous(argtypes) &&
(typeargtypes==null || !Type.isErroneous(typeargtypes)))
logResolveError(errSym, pos, site, name, argtypes, typeargtypes);
logResolveError(errSym, pos, location, site, name, argtypes, typeargtypes);
sym = errSym.access(name, qualified ? site.tsym : syms.noSymbol);
}
return sym;
}
/** Same as above, but without type arguments and arguments.
/** Same as original access(), but without location.
*/
Symbol access(Symbol sym,
DiagnosticPosition pos,
Type site,
Name name,
boolean qualified,
List<Type> argtypes,
List<Type> typeargtypes) {
return access(sym, pos, site.tsym, site, name, qualified, argtypes, typeargtypes);
}
/** Same as original access(), but without type arguments and arguments.
*/
Symbol access(Symbol sym,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
boolean qualified) {
if (sym.kind >= AMBIGUOUS)
return access(sym, pos, site, name, qualified, List.<Type>nil(), null);
return access(sym, pos, location, site, name, qualified, List.<Type>nil(), null);
else
return sym;
}
/** Same as original access(), but without location, type arguments and arguments.
*/
Symbol access(Symbol sym,
DiagnosticPosition pos,
Type site,
Name name,
boolean qualified) {
return access(sym, pos, site.tsym, site, name, qualified);
}
/** Check that sym is not an abstract method.
*/
void checkNonAbstract(DiagnosticPosition pos, Symbol sym) {
......@@ -1380,6 +1404,11 @@ public class Resolve {
Symbol resolveQualifiedMethod(DiagnosticPosition pos, Env<AttrContext> env,
Type site, Name name, List<Type> argtypes,
List<Type> typeargtypes) {
return resolveQualifiedMethod(pos, env, site.tsym, site, name, argtypes, typeargtypes);
}
Symbol resolveQualifiedMethod(DiagnosticPosition pos, Env<AttrContext> env,
Symbol location, Type site, Name name, List<Type> argtypes,
List<Type> typeargtypes) {
Symbol sym = startResolution();
List<MethodResolutionPhase> steps = methodResolutionSteps;
while (steps.nonEmpty() &&
......@@ -1404,7 +1433,7 @@ public class Resolve {
MethodResolutionPhase errPhase =
firstErroneousResolutionPhase();
sym = access(methodResolutionCache.get(errPhase),
pos, site, name, true, argtypes, typeargtypes);
pos, location, site, name, true, argtypes, typeargtypes);
env.info.varArgs = errPhase.isVarargsRequired;
}
} else if (allowMethodHandles && sym.isPolymorphicSignatureGeneric()) {
......@@ -1471,7 +1500,7 @@ public class Resolve {
List<Type> argtypes,
List<Type> typeargtypes) {
Symbol sym = resolveQualifiedMethod(
pos, env, site, name, argtypes, typeargtypes);
pos, env, site.tsym, site, name, argtypes, typeargtypes);
if (sym.kind == MTH) return (MethodSymbol)sym;
else throw new FatalError(
diags.fragment("fatal.err.cant.locate.meth",
......@@ -1546,11 +1575,13 @@ public class Resolve {
null;
Symbol errSym = new ResolveError(WRONG_MTH, "diamond error") {
@Override
JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) {
JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos,
Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) {
String key = details == null ?
"cant.apply.diamond" :
"cant.apply.diamond.1";
return diags.create(dkind, log.currentSource(), pos, key, diags.fragment("diamond", site.tsym), details);
return diags.create(dkind, log.currentSource(), pos, key,
diags.fragment("diamond", site.tsym), details);
}
};
MethodResolutionPhase errPhase = firstErroneousResolutionPhase();
......@@ -1729,17 +1760,18 @@ public class Resolve {
public void logAccessError(Env<AttrContext> env, JCTree tree, Type type) {
AccessError error = new AccessError(env, type.getEnclosingType(), type.tsym);
logResolveError(error, tree.pos(), type.getEnclosingType(), null, null, null);
logResolveError(error, tree.pos(), type.getEnclosingType().tsym, type.getEnclosingType(), null, null, null);
}
//where
private void logResolveError(ResolveError error,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
List<Type> argtypes,
List<Type> typeargtypes) {
JCDiagnostic d = error.getDiagnostic(JCDiagnostic.DiagnosticType.ERROR,
pos, site, name, argtypes, typeargtypes);
pos, location, site, name, argtypes, typeargtypes);
if (d != null) {
d.setFlag(DiagnosticFlag.RESOLVE_ERROR);
log.report(d);
......@@ -1809,6 +1841,7 @@ public class Resolve {
*/
abstract JCDiagnostic getDiagnostic(JCDiagnostic.DiagnosticType dkind,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
List<Type> argtypes,
......@@ -1874,6 +1907,7 @@ public class Resolve {
@Override
JCDiagnostic getDiagnostic(JCDiagnostic.DiagnosticType dkind,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
List<Type> argtypes,
......@@ -1884,16 +1918,23 @@ public class Resolve {
return null;
if (isOperator(name)) {
boolean isUnaryOp = argtypes.size() == 1;
String key = argtypes.size() == 1 ?
"operator.cant.be.applied" :
"operator.cant.be.applied.1";
Type first = argtypes.head;
Type second = !isUnaryOp ? argtypes.tail.head : null;
return diags.create(dkind, log.currentSource(), pos,
"operator.cant.be.applied", name, argtypes);
key, name, first, second);
}
boolean hasLocation = false;
if (!site.tsym.name.isEmpty()) {
if (site.tsym.kind == PCK && !site.tsym.exists()) {
if (!location.name.isEmpty()) {
if (location.kind == PCK && !site.tsym.exists()) {
return diags.create(dkind, log.currentSource(), pos,
"doesnt.exist", site.tsym);
"doesnt.exist", location);
}
hasLocation = true;
hasLocation = !location.name.equals(names._this) &&
!location.name.equals(names._super);
}
boolean isConstructor = kind == ABSENT_MTH &&
name == names.table.names.init;
......@@ -1904,7 +1945,7 @@ public class Resolve {
return diags.create(dkind, log.currentSource(), pos,
errKey, kindname, idname, //symbol kindname, name
typeargtypes, argtypes, //type parameters and arguments (if any)
typeKindName(site), site); //location kindname, type
getLocationDiag(location)); //location kindname, type
}
else {
return diags.create(dkind, log.currentSource(), pos,
......@@ -1925,6 +1966,16 @@ public class Resolve {
}
return key + suffix;
}
private JCDiagnostic getLocationDiag(Symbol location) {
boolean isVar = location.kind == VAR;
String key = isVar ?
"location.1" :
"location";
return diags.fragment(key,
kindName(location),
location,
isVar ? location.type : null);
}
}
/**
......@@ -1965,6 +2016,7 @@ public class Resolve {
@Override
JCDiagnostic getDiagnostic(JCDiagnostic.DiagnosticType dkind,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
List<Type> argtypes,
......@@ -2016,6 +2068,7 @@ public class Resolve {
@Override
JCDiagnostic getDiagnostic(JCDiagnostic.DiagnosticType dkind,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
List<Type> argtypes,
......@@ -2031,7 +2084,7 @@ public class Resolve {
return new JCDiagnostic.MultilineDiagnostic(err, candidateDetails(site));
} else {
return new SymbolNotFoundError(ABSENT_MTH).getDiagnostic(dkind, pos,
site, name, argtypes, typeargtypes);
location, site, name, argtypes, typeargtypes);
}
}
......@@ -2131,6 +2184,7 @@ public class Resolve {
@Override
JCDiagnostic getDiagnostic(JCDiagnostic.DiagnosticType dkind,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
List<Type> argtypes,
......@@ -2140,7 +2194,7 @@ public class Resolve {
if (sym.name == names.init && sym.owner != site.tsym) {
return new SymbolNotFoundError(ABSENT_MTH).getDiagnostic(dkind,
pos, site, name, argtypes, typeargtypes);
pos, location, site, name, argtypes, typeargtypes);
}
else if ((sym.flags() & PUBLIC) != 0
|| (env != null && this.site != null
......@@ -2175,6 +2229,7 @@ public class Resolve {
@Override
JCDiagnostic getDiagnostic(JCDiagnostic.DiagnosticType dkind,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
List<Type> argtypes,
......@@ -2205,6 +2260,7 @@ public class Resolve {
@Override
JCDiagnostic getDiagnostic(JCDiagnostic.DiagnosticType dkind,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
List<Type> argtypes,
......
......@@ -112,11 +112,9 @@ compiler.err.cant.inherit.diff.arg=\
compiler.err.catch.without.try=\
''catch'' without ''try''
compiler.err.clash.with.pkg.of.same.name=\
{0} clashes with package of same name
{0} {1} clashes with package of same name
compiler.err.const.expr.req=\
constant expression required
compiler.err.enum.const.req=\
unqualified enumeration constant name required
compiler.err.cont.outside.loop=\
continue outside of loop
compiler.err.cyclic.inheritance=\
......@@ -184,7 +182,9 @@ compiler.err.multicatch.parameter.may.not.be.assigned=\
compiler.err.finally.without.try=\
''finally'' without ''try''
compiler.err.foreach.not.applicable.to.type=\
foreach not applicable to expression type
for-each not applicable to expression type\n\
required: {1}\n\
found: {0}
compiler.err.fp.number.too.large=\
floating point number too large
compiler.err.fp.number.too.small=\
......@@ -238,7 +238,7 @@ compiler.err.import.requires.canonical=\
compiler.err.improperly.formed.type.param.missing=\
improperly formed type, some parameters are missing
compiler.err.improperly.formed.type.inner.raw.param=\
improperly formed type, type parameters given on a raw type
improperly formed type, type arguments given on a raw type
compiler.err.incomparable.types=\
incomparable types: {0} and {1}
compiler.err.int.number.too.large=\
......@@ -354,7 +354,11 @@ compiler.err.not.encl.class=\
not an enclosing class: {0}
compiler.err.operator.cant.be.applied=\
operator {0} cannot be applied to {1}
bad operand type {1} for unary operator ''{0}''
compiler.err.operator.cant.be.applied.1=\
bad operand types for binary operator ''{0}''\n\
first type: {1}\n\
second type: {2}
compiler.err.pkg.annotations.sb.in.package-info.java=\
package annotations should be in file package-info.java
......@@ -481,9 +485,10 @@ compiler.err.io.exception=\
compiler.err.undef.label=\
undefined label: {0}
compiler.err.undetermined.type=\
type parameters of {0} cannot be determined
cannot infer type arguments for {0}
compiler.err.undetermined.type.1=\
type parameters of {0} cannot be determined; {1}
cannot infer type arguments for {0};\n\
reason: {1}
compiler.err.invalid.inferred.types=\
invalid inferred types for {0}; {1}
compiler.err.cant.apply.diamond=\
......@@ -863,7 +868,7 @@ compiler.warn.annotation.method.not.found.reason=\
compiler.warn.raw.class.use=\
found raw type: {0}\n\
missing type parameters for generic class {1}
missing type arguments for generic class {1}
compiler.warn.diamond.redundant.args=\
redundant type arguments in new expression (use diamond operator instead).
......@@ -991,10 +996,7 @@ compiler.misc.wrong.version=\
#####
compiler.err.not.within.bounds=\
type parameter {0} is not within its bound
compiler.err.not.within.bounds.explain=\
type parameter {0} is not within its bound; {1}
type argument {0} is not within bounds of type-variable {1}
## The following are all possible strings for the second argument ({1}) of the
## above string.
......@@ -1061,6 +1063,8 @@ compiler.misc.type.req.class=\
class
compiler.misc.type.req.class.array=\
class or array
compiler.misc.type.req.array.or.iterable=\
array or java.lang.Iterable
compiler.misc.type.req.ref=\
reference
compiler.misc.type.req.exact=\
......@@ -1144,22 +1148,31 @@ compiler.err.cant.resolve.args.params=\
symbol: {0} <{2}>{1}({3})
## arguments from {0} to {3} have the same meaning as above
## The fifth argument {4} is the location "kindname" (e.g. 'constructor', 'field', etc.)
## The sixth argument {5} is the location type
## The fifth argument {4} is a location subdiagnostic (see below)
compiler.err.cant.resolve.location=\
cannot find symbol\n\
symbol: {0} {1}\n\
location: {4} {5}
location: {4}
compiler.err.cant.resolve.location.args=\
cannot find symbol\n\
symbol: {0} {1}({3})\n\
location: {4} {5}
location: {4}
compiler.err.cant.resolve.location.args.params=\
cannot find symbol\n\
symbol: {0} <{2}>{1}({3})\n\
location: {4} {5}
location: {4}
##a location subdiagnostic is composed as follows:
## The first argument {0} is the location "kindname" (e.g. 'constructor', 'field', etc.)
## The second argument {1} is the location name
## The third argument {2} is the location type (only when {1} is a variable name)
compiler.misc.location=\
{0} {1}
compiler.misc.location.1=\
{0} {1} of type {2}
## The following are all possible string for "kindname".
## They should be called whatever the JLS calls them after it been translated
......
T6304921.java:29:34: compiler.warn.raw.class.use: java.util.ArrayList, java.util.ArrayList<E>
T6304921.java:29:30: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.ArrayList, java.util.List<java.lang.Integer>
- compiler.err.warnings.and.werror
T6304921.java:35:15: compiler.err.cant.resolve.location: kindname.variable, orr, , , kindname.class, java.lang.System
T6304921.java:38:20: compiler.err.operator.cant.be.applied: +, int,boolean
T6304921.java:35:15: compiler.err.cant.resolve.location: kindname.variable, orr, , , (compiler.misc.location: kindname.class, java.lang.System, null)
T6304921.java:38:20: compiler.err.operator.cant.be.applied.1: +, int, boolean
3 errors
2 warnings
T6330920.java:11:22: compiler.err.cant.resolve.location: kindname.class, T6330920Missing, , , kindname.class, T6330920
T6330920.java:11:22: compiler.err.cant.resolve.location: kindname.class, T6330920Missing, , , (compiler.misc.location: kindname.class, T6330920, null)
1 error
T6717241a.java:13:21: compiler.err.cant.resolve: kindname.variable, v, ,
T6717241a.java:15:10: compiler.err.cant.resolve.args: kindname.method, m1, , int,java.lang.String
T6717241a.java:17:10: compiler.err.cant.resolve.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String
T6717241a.java:13:21: compiler.err.cant.resolve.location: kindname.variable, v, , , (compiler.misc.location.1: kindname.variable, x, X)
T6717241a.java:15:10: compiler.err.cant.resolve.location.args: kindname.method, m1, , int,java.lang.String, (compiler.misc.location.1: kindname.variable, x, X)
T6717241a.java:17:10: compiler.err.cant.resolve.location.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String, (compiler.misc.location.1: kindname.variable, x, X)
3 errors
T6717241b.java:12:20: compiler.err.cant.resolve.location: kindname.variable, v, , , kindname.class, T6717241b
T6717241b.java:14:9: compiler.err.cant.resolve.location.args: kindname.method, m1, , int,java.lang.String, kindname.class, T6717241b
T6717241b.java:16:18: compiler.err.cant.resolve.location.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String, kindname.class, T6717241b
T6717241b.java:12:20: compiler.err.cant.resolve.location: kindname.variable, v, , , (compiler.misc.location: kindname.class, T6717241b, null)
T6717241b.java:14:9: compiler.err.cant.resolve.location.args: kindname.method, m1, , int,java.lang.String, (compiler.misc.location: kindname.class, T6717241b, null)
T6717241b.java:16:18: compiler.err.cant.resolve.location.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String, (compiler.misc.location: kindname.class, T6717241b, null)
3 errors
T6857948.java:16:32: compiler.err.cant.resolve.location.args: kindname.method, nosuchfunction, , , kindname.class, Test
T6857948.java:16:32: compiler.err.cant.resolve.location.args: kindname.method, nosuchfunction, , , (compiler.misc.location: kindname.class, Test, null)
T6857948.java:16:50: compiler.err.cant.apply.symbol.1: kindname.constructor, Foo, java.lang.String, compiler.misc.no.args, kindname.class, Foo, (compiler.misc.arg.length.mismatch)
2 errors
T6863465c.java:13:47: compiler.err.cant.resolve.location: kindname.class, d, , , kindname.class, T6863465c.z
T6863465c.java:13:47: compiler.err.cant.resolve.location: kindname.class, d, , , (compiler.misc.location: kindname.class, T6863465c.z, null)
T6863465c.java:11:12: compiler.err.cyclic.inheritance: T6863465c.z
2 errors
T6863465d.java:13:47: compiler.err.cant.resolve.location: kindname.class, w, , , kindname.class, T6863465d.c
T6863465d.java:13:47: compiler.err.cant.resolve.location: kindname.class, w, , , (compiler.misc.location: kindname.class, T6863465d.c, null)
T6863465d.java:11:12: compiler.err.cyclic.inheritance: T6863465d.c
2 errors
T6247324.java:18:6: compiler.err.cant.resolve.location: kindname.class, Seetharam, , , kindname.class, Pair<X,Y>
T6247324.java:18:6: compiler.err.cant.resolve.location: kindname.class, Seetharam, , , (compiler.misc.location: kindname.class, Pair, null)
1 error
ResourceOutsideTry.java:14:13: compiler.err.cant.resolve.location: kindname.variable, c, , , kindname.class, ResourceOutsideTry
ResourceOutsideTry.java:16:13: compiler.err.cant.resolve.location: kindname.variable, c, , , kindname.class, ResourceOutsideTry
ResourceOutsideTry.java:14:13: compiler.err.cant.resolve.location: kindname.variable, c, , , (compiler.misc.location: kindname.class, ResourceOutsideTry, null)
ResourceOutsideTry.java:16:13: compiler.err.cant.resolve.location: kindname.variable, c, , , (compiler.misc.location: kindname.class, ResourceOutsideTry, null)
2 errors
......@@ -24,7 +24,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.not.within.bounds.explain # UNUSED?
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
......
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -23,9 +23,8 @@
// key: compiler.err.cant.resolve
class CantResolve<T extends Object & java.io.Serializable> {
T t;
void m() {
Object o = t.v;
}
class CantResolve {
Object o = new Object() {
int i = f;
};
}
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -23,9 +23,8 @@
// key: compiler.err.cant.resolve.args.params
class CantResolveArgsParams<T extends Object & java.io.Serializable> {
T t;
void m() {
t.<Integer,Double>m2(1, "");
}
class CantResolveArgsParams {
Object o = new Object() {
{ this.<Integer,Double>m2(1, ""); }
};
}
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -22,6 +22,7 @@
*/
// key: compiler.err.cant.resolve.location
// key: compiler.misc.location
class CantResolveLocation {
Unknown y;
......
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -22,6 +22,7 @@
*/
// key: compiler.err.cant.resolve.location.args
// key: compiler.misc.location
class X {
void m() {
......
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -22,6 +22,7 @@
*/
// key: compiler.err.cant.resolve.location.args.params
// key: compiler.misc.location
import java.util.*;
......
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -22,6 +22,7 @@
*/
// key: compiler.err.foreach.not.applicable.to.type
// key: compiler.misc.type.req.array.or.iterable
class ForeachNotApplicable {
void m(String arg) {
......
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -23,6 +23,7 @@
// key: compiler.misc.kindname.class
// key: compiler.err.cant.resolve.location
// key: compiler.misc.location
// key: compiler.misc.count.error
// run: backdoor
......
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -24,6 +24,7 @@
// key: compiler.misc.kindname.method
// key: compiler.misc.kindname.class
// key: compiler.err.cant.resolve.location.args
// key: compiler.misc.location
// key: compiler.misc.count.error
// run: backdoor
......
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -24,6 +24,7 @@
// key: compiler.misc.kindname.variable
// key: compiler.misc.kindname.class
// key: compiler.err.cant.resolve.location
// key: compiler.misc.location
// key: compiler.misc.count.error
// run: backdoor
......
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* 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
......@@ -21,15 +21,9 @@
* questions.
*/
// key: compiler.err.enum.const.req
// key: compiler.err.cant.resolve.location
// key: compiler.misc.location
class EnumConstRequired {
enum E { A, B, C };
void m(E e) {
switch (e) {
case e:
System.err.println("It's me!");
}
}
class Location {
{ Object o = v; }
}
/*
* 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.err.cant.resolve.location
// key: compiler.misc.location.1
class Location1 {
Object o = null;
{ Object o2 = o.v; }
}
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -24,5 +24,6 @@
// key: compiler.err.operator.cant.be.applied
class OperatorCantBeApplied {
String s = ("a" - "b");
String s = null;
{ s++; }
}
/*
* 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.err.operator.cant.be.applied.1
class OperatorCantBeApplied1 {
String s = ("a" - "b");
}
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
......@@ -23,6 +23,7 @@
// key: compiler.err.static.imp.only.classes.and.interfaces
// key: compiler.err.cant.resolve.location
// key: compiler.misc.location
import static p.Other.array.length;
......
FailOver01.java:10:22: compiler.err.expected: ';'
FailOver01.java:10:16: compiler.err.cant.resolve.location: kindname.variable, x, , , kindname.class, Test
FailOver01.java:10:16: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, Test, null)
2 errors
FailOver02.java:10:1: compiler.err.does.not.override.abstract: Test, close(), java.lang.AutoCloseable
FailOver02.java:12:9: compiler.err.cant.resolve.location.args: kindname.method, close, , , kindname.class, Test
FailOver02.java:12:9: compiler.err.cant.resolve.location.args: kindname.method, close, , , (compiler.misc.location: kindname.class, Test, null)
2 errors
FailOver04.java:11:10: compiler.err.cant.resolve.location: kindname.class, Unknown, , , kindname.class, Test
FailOver04.java:11:10: compiler.err.cant.resolve.location: kindname.class, Unknown, , , (compiler.misc.location: kindname.class, Test, null)
1 error
T6711619a.java:40:14: compiler.err.cant.resolve.args: kindname.method, a, ,
T6711619a.java:41:14: compiler.err.cant.resolve.args: kindname.method, b, ,
T6711619a.java:40:14: compiler.err.cant.resolve.location.args: kindname.method, a, , , (compiler.misc.location.1: kindname.variable, t, T)
T6711619a.java:41:14: compiler.err.cant.resolve.location.args: kindname.method, b, , , (compiler.misc.location.1: kindname.variable, t, T)
T6711619a.java:46:19: compiler.err.report.access: a, private, T6711619a.A
T6711619a.java:47:19: compiler.err.report.access: b, private, T6711619a.B
T6711619a.java:48:19: compiler.err.report.access: a, private, T6711619a.A
......
Neg01.java:18:15: compiler.err.not.within.bounds: java.lang.String
Neg01.java:18:15: compiler.err.not.within.bounds: java.lang.String, X
Neg01.java:18:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:19:15: compiler.err.not.within.bounds: ? extends java.lang.String
Neg01.java:19:15: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg01.java:19:38: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:20:23: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:21:15: compiler.err.not.within.bounds: ? super java.lang.String
Neg01.java:21:15: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg01.java:21:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:23:15: compiler.err.not.within.bounds: java.lang.String
Neg01.java:23:15: compiler.err.not.within.bounds: java.lang.String, X
Neg01.java:23:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:24:15: compiler.err.not.within.bounds: ? extends java.lang.String
Neg01.java:24:15: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg01.java:24:38: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:25:23: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:26:15: compiler.err.not.within.bounds: ? super java.lang.String
Neg01.java:26:15: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg01.java:26:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:28:15: compiler.err.not.within.bounds: java.lang.String
Neg01.java:28:15: compiler.err.not.within.bounds: java.lang.String, X
Neg01.java:28:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:29:15: compiler.err.not.within.bounds: ? extends java.lang.String
Neg01.java:29:15: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg01.java:29:39: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:30:24: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:31:9: compiler.err.cant.resolve.location: kindname.class, Foo, , , kindname.class, Neg01<X>
Neg01.java:31:9: compiler.err.cant.resolve.location: kindname.class, Foo, , , (compiler.misc.location: kindname.class, Neg01, null)
Neg01.java:31:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:33:15: compiler.err.not.within.bounds: java.lang.String
Neg01.java:33:15: compiler.err.not.within.bounds: java.lang.String, X
Neg01.java:33:29: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:34:15: compiler.err.not.within.bounds: ? extends java.lang.String
Neg01.java:34:15: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg01.java:34:39: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:35:24: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
Neg01.java:36:15: compiler.err.not.within.bounds: ? super java.lang.String
Neg01.java:36:15: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg01.java:36:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
28 errors
Neg02.java:19:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:19:13: compiler.err.not.within.bounds: java.lang.String, X
Neg02.java:19:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:20:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:20:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg02.java:20:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:21:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:22:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:22:13: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg02.java:22:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:24:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:24:13: compiler.err.not.within.bounds: java.lang.String, X
Neg02.java:24:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:25:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:25:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg02.java:25:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:26:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:27:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:27:13: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg02.java:27:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:29:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:29:13: compiler.err.not.within.bounds: java.lang.String, X
Neg02.java:29:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:30:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:30:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg02.java:30:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:31:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:32:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:32:13: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg02.java:32:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:34:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:34:13: compiler.err.not.within.bounds: java.lang.String, X
Neg02.java:34:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:35:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:35:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg02.java:35:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:36:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:37:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:37:13: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg02.java:37:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:41:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:41:13: compiler.err.not.within.bounds: java.lang.String, X
Neg02.java:41:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:42:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:42:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg02.java:42:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:43:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:44:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:44:13: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg02.java:44:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:46:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:46:13: compiler.err.not.within.bounds: java.lang.String, X
Neg02.java:46:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:47:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:47:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg02.java:47:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:48:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:49:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:49:13: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg02.java:49:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:51:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:51:13: compiler.err.not.within.bounds: java.lang.String, X
Neg02.java:51:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:52:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:52:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg02.java:52:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:53:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:54:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:54:13: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg02.java:54:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:56:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:56:13: compiler.err.not.within.bounds: java.lang.String, X
Neg02.java:56:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:57:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:57:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
Neg02.java:57:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:58:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
Neg02.java:59:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:59:13: compiler.err.not.within.bounds: ? super java.lang.String, X
Neg02.java:59:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
56 errors
Neg03.java:19:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:19:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:19:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:20:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:20:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:20:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:21:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:22:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:22:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:22:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:24:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:24:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:24:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:25:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:25:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:25:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:26:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:27:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:27:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:27:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:29:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:29:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:29:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:30:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:30:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:30:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:31:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:32:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:32:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:32:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:34:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:34:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:34:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:35:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:35:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:35:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:36:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:37:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:37:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:37:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:41:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:41:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:41:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:42:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:42:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:42:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:43:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:44:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:44:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:44:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:46:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:46:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:46:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:47:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:47:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:47:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:48:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:49:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:49:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:49:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:51:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:51:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:51:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:52:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:52:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:52:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:53:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:54:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:54:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:54:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:56:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:56:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:56:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:57:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:57:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:57:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:58:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:59:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:59:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:59:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:63:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:63:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:63:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:64:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:64:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:64:38: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:65:23: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:66:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:66:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:66:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:68:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:68:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:68:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:69:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:69:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:69:38: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:70:23: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:71:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:71:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:71:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:73:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:73:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:73:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:74:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:74:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:74:39: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:75:24: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:76:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:76:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:76:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:78:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:78:13: compiler.err.not.within.bounds: java.lang.String, V
Neg03.java:78:29: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:79:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:79:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg03.java:79:39: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:80:24: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
Neg03.java:81:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:81:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg03.java:81:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
84 errors
Neg04.java:18:13: compiler.err.not.within.bounds: java.lang.String
Neg04.java:18:13: compiler.err.not.within.bounds: java.lang.String, V
Neg04.java:18:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:19:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg04.java:19:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg04.java:19:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:20:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:21:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg04.java:21:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg04.java:21:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:23:13: compiler.err.not.within.bounds: java.lang.String
Neg04.java:23:13: compiler.err.not.within.bounds: java.lang.String, V
Neg04.java:23:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:24:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg04.java:24:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg04.java:24:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:25:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:26:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg04.java:26:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg04.java:26:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:28:13: compiler.err.not.within.bounds: java.lang.String
Neg04.java:28:13: compiler.err.not.within.bounds: java.lang.String, V
Neg04.java:28:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:29:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg04.java:29:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg04.java:29:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:30:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:31:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg04.java:31:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg04.java:31:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:33:13: compiler.err.not.within.bounds: java.lang.String
Neg04.java:33:13: compiler.err.not.within.bounds: java.lang.String, V
Neg04.java:33:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:34:13: compiler.err.not.within.bounds: ? extends java.lang.String
Neg04.java:34:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
Neg04.java:34:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:35:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
Neg04.java:36:13: compiler.err.not.within.bounds: ? super java.lang.String
Neg04.java:36:13: compiler.err.not.within.bounds: ? super java.lang.String, V
Neg04.java:36:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
28 errors
Neg11.java:15:25: compiler.err.cant.resolve.location: kindname.class, UndeclaredName, , , kindname.class, Neg11
Neg11.java:16:25: compiler.err.cant.resolve.location: kindname.class, UndeclaredName, , , kindname.class, Neg11
Neg11.java:15:25: compiler.err.cant.resolve.location: kindname.class, UndeclaredName, , , (compiler.misc.location: kindname.class, Neg11, null)
Neg11.java:16:25: compiler.err.cant.resolve.location: kindname.class, UndeclaredName, , , (compiler.misc.location: kindname.class, Neg11, null)
2 errors
T6943278.java:7:35: compiler.err.cant.resolve: kindname.class, NonExistentInterface, ,
T6943278.java:9:25: compiler.err.cant.resolve.location: kindname.class, NonExistentInterface, , , kindname.class, T6943278<X>
T6943278.java:9:25: compiler.err.cant.resolve.location: kindname.class, NonExistentInterface, , , (compiler.misc.location: kindname.class, T6943278, null)
2 errors
Compatibility.java:36:35: compiler.err.not.within.bounds: Test.Y
Compatibility.java:36:35: compiler.err.not.within.bounds: Test.Y, T
1 error
Compatibility.java:36:35: compiler.err.not.within.bounds: Test.Y
Compatibility.java:36:35: compiler.err.not.within.bounds: Test.Y, T
1 error
/*
* @test /nodynamiccopyright/
* @bug 6968793
* @summary javac generates spourious diagnostics for ill-formed type-variable bounds
* @author mcimadamore
* @compile/fail/ref=T6968793.out -XDrawDiagnostics T6968793.java
*/
class T6968793<X extends Number, Y extends X, Z extends Object & Comparable<Y>> {
T6968793<Object, Object, Object> o;
}
T6968793.java:10:14: compiler.err.not.within.bounds: java.lang.Object, X
T6968793.java:10:22: compiler.err.not.within.bounds: java.lang.Object, Y
T6968793.java:10:30: compiler.err.not.within.bounds: java.lang.Object, Z
3 errors
......@@ -12,6 +12,6 @@
[generate code A2]
[attribute B]
[attribute B1]
B.java:12:9: compiler.err.cant.resolve.location: kindname.variable, x, , , kindname.class, B1
B.java:12:9: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, B1, null)
[attribute B2]
1 error
......@@ -15,7 +15,7 @@
[desugar B]
[generate code B]
[attribute B1]
B.java:12:9: compiler.err.cant.resolve.location: kindname.variable, x, , , kindname.class, B1
B.java:12:9: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, B1, null)
[attribute B2]
[attribute D]
[attribute D1]
......
......@@ -3,7 +3,7 @@
[attribute A2]
[attribute B]
[attribute B1]
B.java:12:9: compiler.err.cant.resolve.location: kindname.variable, x, , , kindname.class, B1
B.java:12:9: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, B1, null)
[attribute B2]
[attribute D]
[attribute D1]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册