8005964: Regression: difference in error recovery after ambiguity causes JCK test failure
Summary: Wrong implementation of ResolveError.access in AmbiguityError
Reviewed-by: jjh
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Wed Jan 16 16:30:11 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Wed Jan 16 17:40:28 2013 +0000
@@ -3421,7 +3421,10 @@
@Override
protected Symbol access(Name name, TypeSymbol location) {
- return ambiguousSyms.last();
+ Symbol firstAmbiguity = ambiguousSyms.last();
+ return firstAmbiguity.kind == TYP ?
+ types.createErrorType(name, location, firstAmbiguity.type).tsym :
+ firstAmbiguity;
}
}