8005964: Regression: difference in error recovery after ambiguity causes JCK test failure
authormcimadamore
Wed, 16 Jan 2013 17:40:28 +0000
changeset 15362 f564dcca5525
parent 15361 01f1828683e6
child 15363 5c503b455dc8
8005964: Regression: difference in error recovery after ambiguity causes JCK test failure Summary: Wrong implementation of ResolveError.access in AmbiguityError Reviewed-by: jjh
langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
--- 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;
         }
     }