-
Bug
-
Resolution: Fixed
-
P3
-
21
-
b12
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8314680 | 21.0.1 | Angelos Bimpoudis | P3 | Resolved | Fixed | b08 |
[~tvaleev] reported the following case which should be protected under the --enable-preview flag for JEP 443
https://mail.openjdk.org/pipermail/amber-spec-experts/2023-August/003909.html
public class Test {
record R1() {}
record R2() {}
static void test(Object obj) {
switch (obj) {
case R1(), R2() -> System.out.println("R1 or R2");
default -> System.out.println("other");
}
}
public static void main(String[] args) {
test(new R1());
}
}
https://mail.openjdk.org/pipermail/amber-spec-experts/2023-August/003909.html
public class Test {
record R1() {}
record R2() {}
static void test(Object obj) {
switch (obj) {
case R1(), R2() -> System.out.println("R1 or R2");
default -> System.out.println("other");
}
}
public static void main(String[] args) {
test(new R1());
}
}
- backported by
-
JDK-8314680 Multiple patterns without unnamed variables
- Resolved