diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2021-06-04 04:35:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-04 04:35:02 +0200 |
commit | 0ce8721960cefe32c01273e0e1b3a6f3a9eb474a (patch) | |
tree | 9f7c401efe07edc307bf27d627da8bba68818ab2 /test/transform/resource | |
parent | 5523aca3b7a46072b4ecf9d836db7d0a84d3f731 (diff) | |
parent | 400e0f75441d4027c8ccdc5f18c1b06f7bc479d9 (diff) | |
download | lombok-0ce8721960cefe32c01273e0e1b3a6f3a9eb474a.tar.gz lombok-0ce8721960cefe32c01273e0e1b3a6f3a9eb474a.tar.bz2 lombok-0ce8721960cefe32c01273e0e1b3a6f3a9eb474a.zip |
Merge pull request #2816 from Rawi01/val-switch-expression
Resolve variables in switch expressions
Diffstat (limited to 'test/transform/resource')
3 files changed, 40 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/ValSwitchExpression.java b/test/transform/resource/after-delombok/ValSwitchExpression.java new file mode 100644 index 00000000..a8fa9b0f --- /dev/null +++ b/test/transform/resource/after-delombok/ValSwitchExpression.java @@ -0,0 +1,11 @@ +// version 14: +public class ValSwitchExpression { + public void method(int arg) { + final int x = switch (arg) { + default -> { + final java.lang.String s = "string"; + yield arg; + } + }; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValSwitchExpression.java b/test/transform/resource/after-ecj/ValSwitchExpression.java new file mode 100644 index 00000000..59b503cb --- /dev/null +++ b/test/transform/resource/after-ecj/ValSwitchExpression.java @@ -0,0 +1,16 @@ +// version 14: +import lombok.val; +public class ValSwitchExpression { + public ValSwitchExpression() { + super(); + } + public void method(int arg) { + final @val int x = switch (arg) { + default -> + { + final @val java.lang.String s = "string"; + yield arg; + } + }; + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/ValSwitchExpression.java b/test/transform/resource/before/ValSwitchExpression.java new file mode 100644 index 00000000..c3838acc --- /dev/null +++ b/test/transform/resource/before/ValSwitchExpression.java @@ -0,0 +1,13 @@ +// version 14: +import lombok.val; + +public class ValSwitchExpression { + public void method(int arg) { + val x = switch (arg) { + default -> { + val s = "string"; + yield arg; + } + }; + } +} |