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

Print this page

        

*** 748,758 **** public void visitTypeCast(JCTypeCast tree) { tree.clazz = translate(tree.clazz, null); Type originalTarget = tree.type; tree.type = erasure(tree.type); tree.expr = translate(tree.expr, tree.type); ! if (originalTarget.isCompound()) { Type.IntersectionClassType ict = (Type.IntersectionClassType)originalTarget; for (Type c : ict.getExplicitComponents()) { Type ec = erasure(c); if (!types.isSameType(ec, tree.type)) { tree.expr = coerce(tree.expr, ec); --- 748,758 ---- public void visitTypeCast(JCTypeCast tree) { tree.clazz = translate(tree.clazz, null); Type originalTarget = tree.type; tree.type = erasure(tree.type); tree.expr = translate(tree.expr, tree.type); ! if (originalTarget.isIntersection()) { Type.IntersectionClassType ict = (Type.IntersectionClassType)originalTarget; for (Type c : ict.getExplicitComponents()) { Type ec = erasure(c); if (!types.isSameType(ec, tree.type)) { tree.expr = coerce(tree.expr, ec);