< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java

Print this page




 279             //distinct type of array node.
 280             ArrayType atype = (ArrayType)tree.vartype.type;
 281             tree.vartype.type = atype.makeVarargs();
 282         }
 283         WriteableScope enclScope = enter.enterScope(env);
 284         Type vartype = tree.isImplicitlyTyped()
 285                 ? env.info.scope.owner.kind == MTH ? Type.noType : syms.errType
 286                 : tree.vartype.type;
 287         VarSymbol v = new VarSymbol(0, tree.name, vartype, enclScope.owner);
 288         v.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, v, tree);
 289         tree.sym = v;
 290         if (tree.init != null) {
 291             v.flags_field |= HASINIT;
 292             if ((v.flags_field & FINAL) != 0 &&
 293                 needsLazyConstValue(tree.init)) {
 294                 Env<AttrContext> initEnv = getInitEnv(tree, env);
 295                 initEnv.info.enclVar = v;
 296                 v.setLazyConstValue(initEnv(tree, initEnv), attr, tree);
 297             }
 298         }
 299         if (chk.checkUnique(tree.pos(), v, enclScope)) {

 300             chk.checkTransparentVar(tree.pos(), v, enclScope);
 301             enclScope.enter(v);
 302         }
 303 
 304         annotate.annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
 305         if (!tree.isImplicitlyTyped()) {
 306             annotate.queueScanTreeAndTypeAnnotate(tree.vartype, localEnv, v, tree.pos());
 307         }
 308 
 309         v.pos = tree.pos;
 310     }
 311     // where
 312     void checkType(JCTree tree, Type type, Error errorKey) {
 313         if (!tree.type.isErroneous() && !types.isSameType(tree.type, type)) {
 314             log.error(tree, errorKey);
 315         }
 316     }
 317     void checkReceiver(JCVariableDecl tree, Env<AttrContext> localEnv) {
 318         attr.attribExpr(tree.nameexpr, localEnv);
 319         MethodSymbol m = localEnv.enclMethod.sym;




 279             //distinct type of array node.
 280             ArrayType atype = (ArrayType)tree.vartype.type;
 281             tree.vartype.type = atype.makeVarargs();
 282         }
 283         WriteableScope enclScope = enter.enterScope(env);
 284         Type vartype = tree.isImplicitlyTyped()
 285                 ? env.info.scope.owner.kind == MTH ? Type.noType : syms.errType
 286                 : tree.vartype.type;
 287         VarSymbol v = new VarSymbol(0, tree.name, vartype, enclScope.owner);
 288         v.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, v, tree);
 289         tree.sym = v;
 290         if (tree.init != null) {
 291             v.flags_field |= HASINIT;
 292             if ((v.flags_field & FINAL) != 0 &&
 293                 needsLazyConstValue(tree.init)) {
 294                 Env<AttrContext> initEnv = getInitEnv(tree, env);
 295                 initEnv.info.enclVar = v;
 296                 v.setLazyConstValue(initEnv(tree, initEnv), attr, tree);
 297             }
 298         }
 299         if ((v.flags_field & (HYPOTHETICAL | RECORD)) != (HYPOTHETICAL | RECORD) &&
 300                 chk.checkUnique(tree.pos(), v, enclScope)) {
 301             chk.checkTransparentVar(tree.pos(), v, enclScope);
 302             enclScope.enter(v);
 303         }
 304 
 305         annotate.annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
 306         if (!tree.isImplicitlyTyped()) {
 307             annotate.queueScanTreeAndTypeAnnotate(tree.vartype, localEnv, v, tree.pos());
 308         }
 309 
 310         v.pos = tree.pos;
 311     }
 312     // where
 313     void checkType(JCTree tree, Type type, Error errorKey) {
 314         if (!tree.type.isErroneous() && !types.isSameType(tree.type, type)) {
 315             log.error(tree, errorKey);
 316         }
 317     }
 318     void checkReceiver(JCVariableDecl tree, Env<AttrContext> localEnv) {
 319         attr.attribExpr(tree.nameexpr, localEnv);
 320         MethodSymbol m = localEnv.enclMethod.sym;


< prev index next >