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

Print this page

        

*** 3018,3028 **** } // Check that argument types of a reference ==, != are // castable to each other, (JLS???). if ((opc == ByteCodes.if_acmpeq || opc == ByteCodes.if_acmpne)) { ! if (!types.isCastable(left, right, new Warner(tree.pos()))) { log.error(tree.pos(), "incomparable.types", left, right); } } chk.checkDivZero(tree.rhs.pos(), operator, right); --- 3018,3029 ---- } // Check that argument types of a reference ==, != are // castable to each other, (JLS???). if ((opc == ByteCodes.if_acmpeq || opc == ByteCodes.if_acmpne)) { ! if (!types.isEqualityComparable(left, right, ! new Warner(tree.pos()))) { log.error(tree.pos(), "incomparable.types", left, right); } } chk.checkDivZero(tree.rhs.pos(), operator, right);