1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Tue Aug 11 01:13:42 2009 +0100 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Tue Aug 11 01:14:06 2009 +0100 1.3 @@ -1239,7 +1239,10 @@ 1.4 } 1.5 1.6 if (site.tag == CLASS) { 1.7 - if (site.getEnclosingType().tag == CLASS) { 1.8 + Type encl = site.getEnclosingType(); 1.9 + while (encl != null && encl.tag == TYPEVAR) 1.10 + encl = encl.getUpperBound(); 1.11 + if (encl.tag == CLASS) { 1.12 // we are calling a nested class 1.13 1.14 if (tree.meth.getTag() == JCTree.SELECT) { 1.15 @@ -1251,7 +1254,7 @@ 1.16 // to the outer instance type of the class. 1.17 chk.checkRefType(qualifier.pos(), 1.18 attribExpr(qualifier, localEnv, 1.19 - site.getEnclosingType())); 1.20 + encl)); 1.21 } else if (methName == names._super) { 1.22 // qualifier omitted; check for existence 1.23 // of an appropriate implicit qualifier. 1.24 @@ -2042,7 +2045,7 @@ 1.25 Symbol sym = (site.getUpperBound() != null) 1.26 ? selectSym(tree, capture(site.getUpperBound()), env, pt, pkind) 1.27 : null; 1.28 - if (sym == null || isType(sym)) { 1.29 + if (sym == null) { 1.30 log.error(pos, "type.var.cant.be.deref"); 1.31 return syms.errSymbol; 1.32 } else {