diff options
Diffstat (limited to 'tests/features193/Switch3.java')
-rw-r--r-- | tests/features193/Switch3.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/features193/Switch3.java b/tests/features193/Switch3.java index a99622d75..90e528125 100644 --- a/tests/features193/Switch3.java +++ b/tests/features193/Switch3.java @@ -7,15 +7,18 @@ public class Switch3 { } 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; } @@ -29,4 +32,4 @@ aspect X { int around(): call(* foo(..)) { return proceed()*3; } -}
\ No newline at end of file +} |