-
Bug
-
Resolution: Fixed
-
P2
-
19
-
b31
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8289969 | 20 | Jan Lahoda | P2 | Resolved | Fixed | b06 |
JDK-8291394 | 19.0.2 | Jan Lahoda | P2 | Resolved | Fixed | b01 |
JDK-8291232 | 19.0.1 | Jan Lahoda | P2 | Resolved | Fixed | b04 |
Consider this code:
---
class RecordPatternDomination {
void test(Object o) {
switch (o) {
case R(int i) -> {}
case R(int i) -> {} //error here - the pattern is dominated
default -> {}
}
}
record R(int i) {}
}
---
This should produce an error, because the second `R(int i)` pattern dominates the first one (JLS 14.30.3), but it does no produce it.
---
class RecordPatternDomination {
void test(Object o) {
switch (o) {
case R(int i) -> {}
case R(int i) -> {} //error here - the pattern is dominated
default -> {}
}
}
record R(int i) {}
}
---
This should produce an error, because the second `R(int i)` pattern dominates the first one (JLS 14.30.3), but it does no produce it.
- backported by
-
JDK-8289969 Pattern domination not working properly for record patterns
-
- Resolved
-
-
JDK-8291232 Pattern domination not working properly for record patterns
-
- Resolved
-
-
JDK-8291394 Pattern domination not working properly for record patterns
-
- Resolved
-