src/share/classes/com/sun/tools/javac/comp/Attr.java

changeset 638
d6fe0ea070aa
parent 634
27bae58329d5
child 664
4124840b35fe
equal deleted inserted replaced
637:c655e0280bdc 638:d6fe0ea070aa
2006 result = check(tree, owntype, VAL, pkind, pt); 2006 result = check(tree, owntype, VAL, pkind, pt);
2007 } 2007 }
2008 2008
2009 public void visitTypeCast(JCTypeCast tree) { 2009 public void visitTypeCast(JCTypeCast tree) {
2010 Type clazztype = attribType(tree.clazz, env); 2010 Type clazztype = attribType(tree.clazz, env);
2011 chk.validate(tree.clazz, env); 2011 chk.validate(tree.clazz, env, false);
2012 Type exprtype = attribExpr(tree.expr, env, Infer.anyPoly); 2012 Type exprtype = attribExpr(tree.expr, env, Infer.anyPoly);
2013 Type owntype = chk.checkCastable(tree.expr.pos(), exprtype, clazztype); 2013 Type owntype = chk.checkCastable(tree.expr.pos(), exprtype, clazztype);
2014 if (exprtype.constValue() != null) 2014 if (exprtype.constValue() != null)
2015 owntype = cfolder.coerce(exprtype, owntype); 2015 owntype = cfolder.coerce(exprtype, owntype);
2016 result = check(tree, capture(owntype), VAL, pkind, pt); 2016 result = check(tree, capture(owntype), VAL, pkind, pt);
2019 public void visitTypeTest(JCInstanceOf tree) { 2019 public void visitTypeTest(JCInstanceOf tree) {
2020 Type exprtype = chk.checkNullOrRefType( 2020 Type exprtype = chk.checkNullOrRefType(
2021 tree.expr.pos(), attribExpr(tree.expr, env)); 2021 tree.expr.pos(), attribExpr(tree.expr, env));
2022 Type clazztype = chk.checkReifiableReferenceType( 2022 Type clazztype = chk.checkReifiableReferenceType(
2023 tree.clazz.pos(), attribType(tree.clazz, env)); 2023 tree.clazz.pos(), attribType(tree.clazz, env));
2024 chk.validate(tree.clazz, env); 2024 chk.validate(tree.clazz, env, false);
2025 chk.checkCastable(tree.expr.pos(), exprtype, clazztype); 2025 chk.checkCastable(tree.expr.pos(), exprtype, clazztype);
2026 result = check(tree, syms.booleanType, VAL, pkind, pt); 2026 result = check(tree, syms.booleanType, VAL, pkind, pt);
2027 } 2027 }
2028 2028
2029 public void visitIndexed(JCArrayAccess tree) { 2029 public void visitIndexed(JCArrayAccess tree) {

mercurial