-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
5.0, 6
-
generic
-
generic
boolean b = (3 == (Object)null);
compiles because javac performs a boxing conversion followed by a
widening reference conversion. This isn't currently a valid combination
under casting conversion (as required by 15.21.3) but 6526446 will
expand casting conversion and it will become valid.
However, this does not compile, and should:
boolean b = ((Object)null == 3); // incomparable types: java.lang.Object and int
compiles because javac performs a boxing conversion followed by a
widening reference conversion. This isn't currently a valid combination
under casting conversion (as required by 15.21.3) but 6526446 will
expand casting conversion and it will become valid.
However, this does not compile, and should:
boolean b = ((Object)null == 3); // incomparable types: java.lang.Object and int
- duplicates
-
JDK-6558572 javac accepts semantically invalid == test
- Closed
- relates to
-
JDK-6979683 inconsistent interaction of reference cast with box/unbox conversions leaves out a useful case
- Closed
-
JDK-6790039 overhaul cast-conversion (umbrella)
- Closed
-
JDK-6526446 Fixes to JLS5.5 Casting Conversion
- Closed