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 |