Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8269712 | 18 | Jan Lahoda | P3 | Resolved | Fixed | b05 |
JDK-8270679 | 17.0.1 | Jan Lahoda | P3 | Resolved | Fixed | b03 |
As reported here:
https://mail.openjdk.java.net/pipermail/core-libs-dev/2021-June/078693.html
The error recovery could be improved in cases like:
Object obj = ...;
switch (obj) {
case String -> {}
}
$ javac --enable-preview -source 17 /tmp/Test.java
/tmp/Test.java:4: error: cannot find symbol
case String -> {}
^
symbol: variable String
location: class Test
Could produce an error suggesting there should be a pattern instead of a simple identifier.
https://mail.openjdk.java.net/pipermail/core-libs-dev/2021-June/078693.html
The error recovery could be improved in cases like:
Object obj = ...;
switch (obj) {
case String -> {}
}
$ javac --enable-preview -source 17 /tmp/Test.java
/tmp/Test.java:4: error: cannot find symbol
case String -> {}
^
symbol: variable String
location: class Test
Could produce an error suggesting there should be a pattern instead of a simple identifier.
- backported by
-
JDK-8269712 Better error recovery for broken patterns in switch
- Resolved
-
JDK-8270679 Better error recovery for broken patterns in switch
- Resolved