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

changeset 2193
d4cbb671de1c
parent 2191
e79d6425f1c4
child 2200
7c89d200781b
     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Nov 14 13:47:38 2013 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Nov 15 11:08:12 2013 +0000
     1.3 @@ -2697,9 +2697,10 @@
     1.4              Pair<Symbol, Resolve.ReferenceLookupHelper> refResult = null;
     1.5              List<Type> saved_undet = resultInfo.checkContext.inferenceContext().save();
     1.6              try {
     1.7 -                refResult = rs.resolveMemberReference(that.pos(), localEnv, that, that.expr.type,
     1.8 -                        that.name, argtypes, typeargtypes, true, referenceCheck,
     1.9 -                        resultInfo.checkContext.inferenceContext());
    1.10 +                refResult = rs.resolveMemberReference(localEnv, that, that.expr.type,
    1.11 +                        that.name, argtypes, typeargtypes, referenceCheck,
    1.12 +                        resultInfo.checkContext.inferenceContext(),
    1.13 +                        resultInfo.checkContext.deferredAttrContext().mode);
    1.14              } finally {
    1.15                  resultInfo.checkContext.inferenceContext().rollback(saved_undet);
    1.16              }
    1.17 @@ -2719,6 +2720,7 @@
    1.18                      case HIDDEN:
    1.19                      case STATICERR:
    1.20                      case MISSING_ENCL:
    1.21 +                    case WRONG_STATICNESS:
    1.22                          targetError = true;
    1.23                          break;
    1.24                      default:
    1.25 @@ -2770,26 +2772,6 @@
    1.26                      chk.checkRaw(that.expr, localEnv);
    1.27                  }
    1.28  
    1.29 -                if (!that.kind.isUnbound() &&
    1.30 -                        that.getMode() == ReferenceMode.INVOKE &&
    1.31 -                        TreeInfo.isStaticSelector(that.expr, names) &&
    1.32 -                        !that.sym.isStatic()) {
    1.33 -                    log.error(that.expr.pos(), "invalid.mref", Kinds.kindName(that.getMode()),
    1.34 -                            diags.fragment("non-static.cant.be.ref", Kinds.kindName(refSym), refSym));
    1.35 -                    result = that.type = types.createErrorType(target);
    1.36 -                    return;
    1.37 -                }
    1.38 -
    1.39 -                if (that.kind.isUnbound() &&
    1.40 -                        that.getMode() == ReferenceMode.INVOKE &&
    1.41 -                        TreeInfo.isStaticSelector(that.expr, names) &&
    1.42 -                        that.sym.isStatic()) {
    1.43 -                    log.error(that.expr.pos(), "invalid.mref", Kinds.kindName(that.getMode()),
    1.44 -                            diags.fragment("static.method.in.unbound.lookup", Kinds.kindName(refSym), refSym));
    1.45 -                    result = that.type = types.createErrorType(target);
    1.46 -                    return;
    1.47 -                }
    1.48 -
    1.49                  if (that.sym.isStatic() && TreeInfo.isStaticSelector(that.expr, names) &&
    1.50                          exprType.getTypeArguments().nonEmpty()) {
    1.51                      //static ref with class type-args

mercurial