[java-intentions] IDEA-229521 "Return outside of enclosing switch statement" should have a fix to replace 'return' with 'yield'

GitOrigin-RevId: e8cc607a3f5a30e9fac7ea69671062ac14dc2673
This commit is contained in:
Tagir Valeev
2022-09-12 17:37:12 +02:00
committed by intellij-monorepo-bot
parent 2d45c71f18
commit cacf1099f9
6 changed files with 99 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
// "Replace with 'yield'" "true-preview"
class X {
int test(String s) {
return switch (s) {
case "foo" -> {
System.out.println("hello");
yield 123;
}
case "bar" -> 2;
};
}
}