Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8237231 | 15 | Jan Lahoda | P2 | Resolved | Fixed | b06 |
JDK-8237686 | 14.0.2 | Jan Lahoda | P2 | Resolved | Fixed | master |
JDK-8238122 | 14.0.1 | Unassigned | P2 | Resolved | Fixed | b02 |
Originally reported here:
https://mail.openjdk.java.net/pipermail/amber-dev/2019-December/005413.html
Cases like:
---
static void test(Object o1, Object o2) {
boolean b = o1 instanceof String s && (!(o2 instanceof String s)
|| consume(s));
}
---
or:
---
static void test(Object o1, Object o2, Object o3) {
boolean b1 = o1 instanceof String s ? o2 instanceof String s : o3
instanceof String s;
}
---
Are not valid and should not compile, but javac currently accepts them without any compile-time error.
https://mail.openjdk.java.net/pipermail/amber-dev/2019-December/005413.html
Cases like:
---
static void test(Object o1, Object o2) {
boolean b = o1 instanceof String s && (!(o2 instanceof String s)
|| consume(s));
}
---
or:
---
static void test(Object o1, Object o2, Object o3) {
boolean b1 = o1 instanceof String s ? o2 instanceof String s : o3
instanceof String s;
}
---
Are not valid and should not compile, but javac currently accepts them without any compile-time error.
- backported by
-
JDK-8237231 Conflicting bindings accepted in some cases
-
- Resolved
-
-
JDK-8237686 Conflicting bindings accepted in some cases
-
- Resolved
-
-
JDK-8238122 Conflicting bindings accepted in some cases
-
- Resolved
-