diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-07-15 14:23:47 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-07-15 14:23:47 +0100 |
| commit | bc06840e00425db342bc5a021c0900d9e63b71f0 (patch) | |
| tree | 0aa45a4ea475804a36a5ee33f9a726656f45bc1f /src/test/resources/java/switch-statements/com/example/SwitchStatements.java | |
| parent | 3be68289f34a37ac7f9e1e95fa0d95dfc1bb3836 (diff) | |
Split switch handling off to desugar step
Diffstat (limited to 'src/test/resources/java/switch-statements/com/example/SwitchStatements.java')
| -rw-r--r-- | src/test/resources/java/switch-statements/com/example/SwitchStatements.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/resources/java/switch-statements/com/example/SwitchStatements.java b/src/test/resources/java/switch-statements/com/example/SwitchStatements.java new file mode 100644 index 0000000..bebccf9 --- /dev/null +++ b/src/test/resources/java/switch-statements/com/example/SwitchStatements.java @@ -0,0 +1,30 @@ +package com.example; + +public class SwitchStatements { + public static int simpleReturn(String value) { + switch (value) { + case "one": + return 1; + default: + return 0; + } + } + + public static int simpleFallthroughReturn(String value) { + switch (value) { + case "one": + case "two": + return 1; + default: + return 0; + } + } + + public static int noDefaultReturn(String value) { + switch (value) { + case "one": + return 1; + } + return 0; + } +} |
