public void visitAssert(JCAssert tree) { attribExpr(tree.cond, env, syms.booleanType); if (tree.detail != null) { chk.checkNonVoid(tree.detail.pos(), attribExpr(tree.detail, env)); } result = null; }
public void visitAssert(JCAssert tree) { attribExpr(tree.cond, env, syms.booleanType); if (tree.detail != null) { chk.checkNonVoid(tree.detail.pos(), attribExpr(tree.detail, env)); } result = null; }
public void visitAssert(JCAssert tree) { attribExpr(tree.cond, env, syms.booleanType); if (tree.detail != null) { chk.checkNonVoid(tree.detail.pos(), attribExpr(tree.detail, env)); } result = null; }
public void visitConditional(JCConditional tree) { attribExpr(tree.cond, env, syms.booleanType); attribExpr(tree.truepart, env); attribExpr(tree.falsepart, env); result = check(tree, capture(condType(tree.pos(), tree.cond.type, tree.truepart.type, tree.falsepart.type)), VAL, pkind, pt); } //where
public void visitDoLoop(JCDoWhileLoop tree) { attribStat(tree.body, env.dup(tree)); attribExpr(tree.cond, env, syms.booleanType); result = null; }
public void visitWhileLoop(JCWhileLoop tree) { attribExpr(tree.cond, env, syms.booleanType); attribStat(tree.body, env.dup(tree)); result = null; }
public void visitWhileLoop(JCWhileLoop tree) { attribExpr(tree.cond, env, syms.booleanType); attribStat(tree.body, env.dup(tree)); result = null; }
public void visitIf(JCIf tree) { attribExpr(tree.cond, env, syms.booleanType); attribStat(tree.thenpart, env); if (tree.elsepart != null) attribStat(tree.elsepart, env); chk.checkEmptyIf(tree); result = null; }
public void visitIndexed(JCArrayAccess tree) { Type owntype = syms.errType; Type atype = attribExpr(tree.indexed, env); attribExpr(tree.index, env, syms.intType); if (types.isArray(atype)) owntype = types.elemtype(atype); else if (atype.tag != ERROR) log.error(tree.pos(), "array.req.but.found", atype); if ((pkind & VAR) == 0) owntype = capture(owntype); result = check(tree, owntype, VAR, pkind, pt); }
public void visitIndexed(JCArrayAccess tree) { Type owntype = syms.errType; Type atype = attribExpr(tree.indexed, env); attribExpr(tree.index, env, syms.intType); if (types.isArray(atype)) owntype = types.elemtype(atype); else if (atype.tag != ERROR) log.error(tree.pos(), "array.req.but.found", atype); if ((pkind & VAR) == 0) owntype = capture(owntype); result = check(tree, owntype, VAR, pkind, pt); }
public void visitSynchronized(JCSynchronized tree) { chk.checkRefType(tree.pos(), attribExpr(tree.lock, env)); attribStat(tree.body, env); result = null; }
public void visitSynchronized(JCSynchronized tree) { chk.checkRefType(tree.pos(), attribExpr(tree.lock, env)); attribStat(tree.body, env); result = null; }
/** Attribute a list of expressions, returning a list of types. */ List<Type> attribExprs(List<JCExpression> trees, Env<AttrContext> env, Type pt) { ListBuffer<Type> ts = new ListBuffer<Type>(); for (List<JCExpression> l = trees; l.nonEmpty(); l = l.tail) ts.append(attribExpr(l.head, env, pt)); return ts.toList(); }
/** Attribute a list of expressions, returning a list of types. */ List<Type> attribExprs(List<JCExpression> trees, Env<AttrContext> env, Type pt) { ListBuffer<Type> ts = new ListBuffer<Type>(); for (List<JCExpression> l = trees; l.nonEmpty(); l = l.tail) ts.append(attribExpr(l.head, env, pt)); return ts.toList(); }
public void visitAssign(JCAssign tree) { Type owntype = attribTree(tree.lhs, env.dup(tree), varInfo); Type capturedType = capture(owntype); attribExpr(tree.rhs, env, owntype); result = check(tree, capturedType, VAL, resultInfo); }
public void visitIndexed(JCArrayAccess tree) { Type owntype = types.createErrorType(tree.type); Type atype = attribExpr(tree.indexed, env); attribExpr(tree.index, env, syms.intType); if (types.isArray(atype)) owntype = types.elemtype(atype); else if (!atype.hasTag(ERROR)) log.error(tree.pos(), "array.req.but.found", atype); if ((pkind() & VAR) == 0) owntype = capture(owntype); result = check(tree, owntype, VAR, resultInfo); }
public void visitTypeCast(JCTypeCast tree) { Type clazztype = attribType(tree.clazz, env); Type exprtype = attribExpr(tree.expr, env, Infer.anyPoly); Type owntype = chk.checkCastable(tree.expr.pos(), exprtype, clazztype); if (exprtype.constValue() != null) owntype = cfolder.coerce(exprtype, owntype); result = check(tree, capture(owntype), VAL, pkind, pt); }
public void visitTypeCast(JCTypeCast tree) { Type clazztype = attribType(tree.clazz, env); Type exprtype = attribExpr(tree.expr, env, Infer.anyPoly); Type owntype = chk.checkCastable(tree.expr.pos(), exprtype, clazztype); if (exprtype.constValue() != null) owntype = cfolder.coerce(exprtype, owntype); result = check(tree, capture(owntype), VAL, pkind, pt); }
public void visitTypeTest(JCInstanceOf tree) { Type exprtype = chk.checkNullOrRefType( tree.expr.pos(), attribExpr(tree.expr, env)); Type clazztype = chk.checkReifiableReferenceType( tree.clazz.pos(), attribType(tree.clazz, env)); chk.checkCastable(tree.expr.pos(), exprtype, clazztype); result = check(tree, syms.booleanType, VAL, pkind, pt); }
public void visitTypeTest(JCInstanceOf tree) { Type exprtype = chk.checkNullOrRefType( tree.expr.pos(), attribExpr(tree.expr, env)); Type clazztype = chk.checkReifiableReferenceType( tree.clazz.pos(), attribType(tree.clazz, env)); chk.checkCastable(tree.expr.pos(), exprtype, clazztype); result = check(tree, syms.booleanType, VAL, pkind, pt); }