langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 32950 22315d47485b
parent 32912 dd06b5fd9300
child 33363 f03a03067799
equal deleted inserted replaced
32949:7e0f345e64a8 32950:22315d47485b
  3731             default:
  3731             default:
  3732                 throw new AssertionError("unexpected kind: " + sym.kind +
  3732                 throw new AssertionError("unexpected kind: " + sym.kind +
  3733                                          " in tree " + tree);
  3733                                          " in tree " + tree);
  3734             }
  3734             }
  3735 
  3735 
  3736             // Test (1): emit a `deprecation' warning if symbol is deprecated.
  3736             // Emit a `deprecation' warning if symbol is deprecated.
  3737             // (for constructors, the error was given when the constructor was
  3737             // (for constructors (but not for constructor references), the error
  3738             // resolved)
  3738             // was given when the constructor was resolved)
  3739 
  3739 
  3740             if (sym.name != names.init) {
  3740             if (sym.name != names.init || tree.hasTag(REFERENCE)) {
  3741                 chk.checkDeprecated(tree.pos(), env.info.scope.owner, sym);
  3741                 chk.checkDeprecated(tree.pos(), env.info.scope.owner, sym);
  3742                 chk.checkSunAPI(tree.pos(), sym);
  3742                 chk.checkSunAPI(tree.pos(), sym);
  3743                 chk.checkProfile(tree.pos(), sym);
  3743                 chk.checkProfile(tree.pos(), sym);
  3744             }
  3744             }
  3745 
  3745 
  3746             // Test (3): if symbol is a variable, check that its type and
  3746             // If symbol is a variable, check that its type and
  3747             // kind are compatible with the prototype and protokind.
  3747             // kind are compatible with the prototype and protokind.
  3748             return check(tree, owntype, sym.kind.toSelector(), resultInfo);
  3748             return check(tree, owntype, sym.kind.toSelector(), resultInfo);
  3749         }
  3749         }
  3750 
  3750 
  3751         /** Check that variable is initialized and evaluate the variable's
  3751         /** Check that variable is initialized and evaluate the variable's