mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-05 04:40:28 +07:00
Adds a quick-fix: "Lift 'throw' out of 'switch' expression" that that is provided for error "'switch' expression does not have any result expressions". Some rare cases are not handled (fix is not provided for mentioned error). For example when switch is used inside: - initialization/condition/update part of for loop - initializer of class field - condition of do-while loop - lock expression in synchronized statement - any part of assert statement - resource initializer of 'try' statement #IDEA-283208 Fixed Merge-request: IJ-MR-172146 Merged-by: Marcin Mikosik <marcin.mikosik@jetbrains.com> GitOrigin-RevId: a2710c49e16b7f495974fb167bcae01b3d850f7b
16 lines
395 B
Java
16 lines
395 B
Java
// "Lift 'throw' out of 'switch' expression" "true-preview"
|
|
|
|
class Foo {
|
|
int bar() {
|
|
throw <caret>switch (7) {
|
|
default -> {
|
|
new Runnable() {
|
|
public void run() {
|
|
throw new RuntimeException("runnable");
|
|
}
|
|
}.run();
|
|
yield new RuntimeException("message");
|
|
}
|
|
};
|
|
}
|
|
} |