mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
[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:
committed by
intellij-monorepo-bot
parent
2d45c71f18
commit
cacf1099f9
@@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user