src/share/classes/com/sun/tools/javac/comp/Attr.java

changeset 1580
f6e667f52af4
parent 1563
bc456436c613
child 1581
4ff468de829d
equal deleted inserted replaced
1579:0baaae675b19 1580:f6e667f52af4
2620 result = that.type = types.createErrorType(target); 2620 result = that.type = types.createErrorType(target);
2621 return; 2621 return;
2622 } 2622 }
2623 } 2623 }
2624 2624
2625 that.sym = refSym.baseSymbol();
2626 that.kind = lookupHelper.referenceKind(that.sym);
2627
2625 if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) { 2628 if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) {
2626 if (refSym.isStatic() && TreeInfo.isStaticSelector(that.expr, names) && 2629 if (that.sym.isStatic() && TreeInfo.isStaticSelector(that.expr, names) &&
2627 exprType.getTypeArguments().nonEmpty()) { 2630 exprType.getTypeArguments().nonEmpty()) {
2628 //static ref with class type-args 2631 //static ref with class type-args
2629 log.error(that.expr.pos(), "invalid.mref", Kinds.kindName(that.getMode()), 2632 log.error(that.expr.pos(), "invalid.mref", Kinds.kindName(that.getMode()),
2630 diags.fragment("static.mref.with.targs")); 2633 diags.fragment("static.mref.with.targs"));
2631 result = that.type = types.createErrorType(target); 2634 result = that.type = types.createErrorType(target);
2632 return; 2635 return;
2633 } 2636 }
2634 2637
2635 if (refSym.isStatic() && !TreeInfo.isStaticSelector(that.expr, names) && 2638 if (that.sym.isStatic() && !TreeInfo.isStaticSelector(that.expr, names) &&
2636 !lookupHelper.referenceKind(refSym).isUnbound()) { 2639 !that.kind.isUnbound()) {
2637 //no static bound mrefs 2640 //no static bound mrefs
2638 log.error(that.expr.pos(), "invalid.mref", Kinds.kindName(that.getMode()), 2641 log.error(that.expr.pos(), "invalid.mref", Kinds.kindName(that.getMode()),
2639 diags.fragment("static.bound.mref")); 2642 diags.fragment("static.bound.mref"));
2640 result = that.type = types.createErrorType(target); 2643 result = that.type = types.createErrorType(target);
2641 return; 2644 return;
2645 }
2646
2647 if (!refSym.isStatic() && that.kind == JCMemberReference.ReferenceKind.SUPER) {
2648 // Check that super-qualified symbols are not abstract (JLS)
2649 rs.checkNonAbstract(that.pos(), that.sym);
2642 } 2650 }
2643 } 2651 }
2644 2652
2645 if (desc.getReturnType() == Type.recoveryType) { 2653 if (desc.getReturnType() == Type.recoveryType) {
2646 // stop here 2654 // stop here

mercurial