2018-08-29 07:36:17 +00:00
|
|
|
/*
|
2020-12-30 17:20:54 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2018-08-29 07:36:17 +00:00
|
|
|
* @bug 8206986
|
|
|
|
* @summary Verify reasonable errors are produced when neither ':' nor '->'
|
|
|
|
* is found are the expression of a case
|
2019-11-12 06:32:13 +00:00
|
|
|
* @compile/fail/ref=SwitchArrowBrokenConstant.out -Xlint:-preview -XDrawDiagnostics SwitchArrowBrokenConstant.java
|
2018-08-29 07:36:17 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class SwitchArrowBrokenConstant {
|
|
|
|
|
|
|
|
private String likeLambda(int i) {
|
|
|
|
switch (i) {
|
|
|
|
case (a, b) -> {}
|
|
|
|
}
|
|
|
|
return switch (i) {
|
|
|
|
case (a, b) -> {}
|
|
|
|
};
|
|
|
|
switch (i) {
|
|
|
|
case a;
|
|
|
|
}
|
|
|
|
return switch (i) {
|
|
|
|
case a;
|
|
|
|
};
|
|
|
|
switch (i) {
|
|
|
|
default ;
|
|
|
|
}
|
|
|
|
return switch (i) {
|
|
|
|
default ;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|