2018-08-29 09:36:17 +02:00
|
|
|
/*
|
|
|
|
* @test /nodymaticcopyright/
|
|
|
|
* @bug 8206986
|
|
|
|
* @summary Verify reasonable errors are produced when neither ':' nor '->'
|
|
|
|
* is found are the expression of a case
|
2019-02-21 10:29:16 -08:00
|
|
|
* @compile/fail/ref=SwitchArrowBrokenConstant.out -source ${jdk.version} --enable-preview -Xlint:-preview -XDrawDiagnostics SwitchArrowBrokenConstant.java
|
2018-08-29 09:36:17 +02: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 ;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|