So far this was a slight oversight, no test using 'yield' existed in the
'features193' test suite. Better late than never.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
}
public static int one(Color color) {
- int result = switch(color) {
- case R -> 0;
- case G -> 1;
- case B -> 2;
- default -> 3;
+ int result = switch (color) {
+ case R -> 0;
+ case G -> {
+ int number4 = 8 / 2;
+ yield number4 /4;
+ }
+ case B -> 2;
+ default -> 3;
};
return result;
}
enum Color {
R, G, B, Y;
-}
\ No newline at end of file
+}
}
public static int one(Color color) {
- int result = switch(color) {
- case R -> 0;
- case G -> 1;
- case B -> 2;
- default -> 3;
+ int result = switch (color) {
+ case R -> 0;
+ case G -> {
+ int number4 = 8 / 2;
+ yield number4 /4;
+ }
+ case B -> 2;
+ default -> 3;
};
return result;
}
int around(): call(* one(..)) {
return proceed()*2;
}
-}
\ No newline at end of file
+}
}
public static int one(Color color) {
- int result = switch(color) {
- case R -> foo(0);
- case G -> foo(1);
- case B -> foo(2);
- default -> foo(3);
+ int result = switch (color) {
+ case R -> foo(0);
+ case G -> {
+ int number4 = foo(1) - 2;
+ yield number4 +2;
+ }
+ case B -> foo(2);
+ default -> foo(3);
};
return result;
}
-
+
public static final int foo(int i) {
return i+1;
}
int around(): call(* foo(..)) {
return proceed()*3;
}
-}
\ No newline at end of file
+}