1.1 --- a/src/share/classes/com/sun/tools/javac/api/JavacTrees.java Tue Jul 23 20:42:54 2013 -0400 1.2 +++ b/src/share/classes/com/sun/tools/javac/api/JavacTrees.java Wed Jul 24 17:35:42 2013 -0700 1.3 @@ -69,7 +69,6 @@ 1.4 import com.sun.tools.javac.code.Type.ErrorType; 1.5 import com.sun.tools.javac.code.Type.UnionClassType; 1.6 import com.sun.tools.javac.code.Types; 1.7 -import com.sun.tools.javac.code.TypeTag; 1.8 import com.sun.tools.javac.code.Types.TypeRelation; 1.9 import com.sun.tools.javac.comp.Attr; 1.10 import com.sun.tools.javac.comp.AttrContext; 1.11 @@ -358,7 +357,7 @@ 1.12 Log.DeferredDiagnosticHandler deferredDiagnosticHandler = 1.13 new Log.DeferredDiagnosticHandler(log); 1.14 try { 1.15 - final ClassSymbol tsym; 1.16 + final TypeSymbol tsym; 1.17 final Name memberName; 1.18 if (ref.qualifierExpression == null) { 1.19 tsym = env.enclClass.sym; 1.20 @@ -387,7 +386,7 @@ 1.21 return null; 1.22 } 1.23 } else { 1.24 - tsym = (ClassSymbol) t.tsym; 1.25 + tsym = t.tsym; 1.26 memberName = ref.memberName; 1.27 } 1.28 } 1.29 @@ -408,15 +407,17 @@ 1.30 paramTypes = lb.toList(); 1.31 } 1.32 1.33 - Symbol msym = (memberName == tsym.name) 1.34 - ? findConstructor(tsym, paramTypes) 1.35 - : findMethod(tsym, memberName, paramTypes); 1.36 + ClassSymbol sym = (ClassSymbol) types.upperBound(tsym.type).tsym; 1.37 + 1.38 + Symbol msym = (memberName == sym.name) 1.39 + ? findConstructor(sym, paramTypes) 1.40 + : findMethod(sym, memberName, paramTypes); 1.41 if (paramTypes != null) { 1.42 // explicit (possibly empty) arg list given, so cannot be a field 1.43 return msym; 1.44 } 1.45 1.46 - VarSymbol vsym = (ref.paramTypes != null) ? null : findField(tsym, memberName); 1.47 + VarSymbol vsym = (ref.paramTypes != null) ? null : findField(sym, memberName); 1.48 // prefer a field over a method with no parameters 1.49 if (vsym != null && 1.50 (msym == null || 1.51 @@ -789,6 +790,7 @@ 1.52 case METHOD: 1.53 // System.err.println("METHOD: " + ((JCMethodDecl)tree).sym.getSimpleName()); 1.54 method = (JCMethodDecl)tree; 1.55 + env = memberEnter.getMethodEnv(method, env); 1.56 break; 1.57 case VARIABLE: 1.58 // System.err.println("FIELD: " + ((JCVariableDecl)tree).sym.getSimpleName()); 1.59 @@ -800,7 +802,6 @@ 1.60 try { 1.61 Assert.check(method.body == tree); 1.62 method.body = copier.copy((JCBlock)tree, (JCTree) path.getLeaf()); 1.63 - env = memberEnter.getMethodEnv(method, env); 1.64 env = attribStatToTree(method.body, env, copier.leafCopy); 1.65 } finally { 1.66 method.body = (JCBlock) tree;