langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
changeset 19917 ebb957ba7b07
parent 19914 d86271bd430a
child 19940 d6d6e623f0b4
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Sep 03 23:31:33 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Sep 03 23:41:37 2013 +0100
@@ -2546,22 +2546,26 @@
                     @Override
                     Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
                         if (sym.kind >= AMBIGUOUS) {
-                            final JCDiagnostic details = sym.kind == WRONG_MTH ?
-                                            ((InapplicableSymbolError)sym).errCandidate().snd :
-                                            null;
-                            sym = new InapplicableSymbolError(sym.kind, "diamondError", currentResolutionContext) {
-                                @Override
-                                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);
-                                }
-                            };
-                            sym = accessMethod(sym, pos, site, names.init, true, argtypes, typeargtypes);
-                            env.info.pendingResolutionPhase = currentResolutionContext.step;
+                            if (sym.kind == HIDDEN) {
+                                sym = super.access(env, pos, location, sym);
+                            } else {
+                                final JCDiagnostic details = sym.kind == WRONG_MTH ?
+                                                ((InapplicableSymbolError)sym).errCandidate().snd :
+                                                null;
+                                sym = new InapplicableSymbolError(sym.kind, "diamondError", currentResolutionContext) {
+                                    @Override
+                                    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);
+                                    }
+                                };
+                                sym = accessMethod(sym, pos, site, names.init, true, argtypes, typeargtypes);
+                                env.info.pendingResolutionPhase = currentResolutionContext.step;
+                            }
                         }
                         return sym;
                     }});