changeset 1497:1afdf1f1472b

8005964: Regression: difference in error recovery after ambiguity causes JCK test failure Summary: Wrong implementation of ResolveError.access in AmbiguityError Reviewed-by: jjh
author mcimadamore
date Wed, 16 Jan 2013 17:40:28 +0000
parents 7aa2025bbb7b
children 6b6311a8c9cc
files src/share/classes/com/sun/tools/javac/comp/Resolve.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Jan 16 16:30:11 2013 +0000
+++ b/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;
         }
     }