3257 new ResultInfo(VAL, resultInfo.pt.getReturnType(), resultInfo.checkContext),
3258 env, TreeInfo.args(env.tree), resultInfo.pt.getParameterTypes(),
3259 resultInfo.pt.getTypeArguments());
3260 break;
3261 }
3262 case PCK: case ERR:
3263 owntype = sym.type;
3264 break;
3265 default:
3266 throw new AssertionError("unexpected kind: " + sym.kind +
3267 " in tree " + tree);
3268 }
3269
3270 // Test (1): emit a `deprecation' warning if symbol is deprecated.
3271 // (for constructors, the error was given when the constructor was
3272 // resolved)
3273
3274 if (sym.name != names.init) {
3275 chk.checkDeprecated(tree.pos(), env.info.scope.owner, sym);
3276 chk.checkSunAPI(tree.pos(), sym);
3277 }
3278
3279 // Test (3): if symbol is a variable, check that its type and
3280 // kind are compatible with the prototype and protokind.
3281 return check(tree, owntype, sym.kind, resultInfo);
3282 }
3283
3284 /** Check that variable is initialized and evaluate the variable's
3285 * initializer, if not yet done. Also check that variable is not
3286 * referenced before it is defined.
3287 * @param tree The tree making up the variable reference.
3288 * @param env The current environment.
3289 * @param v The variable's symbol.
3290 */
3291 private void checkInit(JCTree tree,
3292 Env<AttrContext> env,
3293 VarSymbol v,
3294 boolean onlyWarning) {
3295 // System.err.println(v + " " + ((v.flags() & STATIC) != 0) + " " +
3296 // tree.pos + " " + v.pos + " " +
|
3257 new ResultInfo(VAL, resultInfo.pt.getReturnType(), resultInfo.checkContext),
3258 env, TreeInfo.args(env.tree), resultInfo.pt.getParameterTypes(),
3259 resultInfo.pt.getTypeArguments());
3260 break;
3261 }
3262 case PCK: case ERR:
3263 owntype = sym.type;
3264 break;
3265 default:
3266 throw new AssertionError("unexpected kind: " + sym.kind +
3267 " in tree " + tree);
3268 }
3269
3270 // Test (1): emit a `deprecation' warning if symbol is deprecated.
3271 // (for constructors, the error was given when the constructor was
3272 // resolved)
3273
3274 if (sym.name != names.init) {
3275 chk.checkDeprecated(tree.pos(), env.info.scope.owner, sym);
3276 chk.checkSunAPI(tree.pos(), sym);
3277 chk.checkProfile(tree.pos(), sym);
3278 }
3279
3280 // Test (3): if symbol is a variable, check that its type and
3281 // kind are compatible with the prototype and protokind.
3282 return check(tree, owntype, sym.kind, resultInfo);
3283 }
3284
3285 /** Check that variable is initialized and evaluate the variable's
3286 * initializer, if not yet done. Also check that variable is not
3287 * referenced before it is defined.
3288 * @param tree The tree making up the variable reference.
3289 * @param env The current environment.
3290 * @param v The variable's symbol.
3291 */
3292 private void checkInit(JCTree tree,
3293 Env<AttrContext> env,
3294 VarSymbol v,
3295 boolean onlyWarning) {
3296 // System.err.println(v + " " + ((v.flags() & STATIC) != 0) + " " +
3297 // tree.pos + " " + v.pos + " " +
|