mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
Predict boolean type for 'when' expression of switch pattern
IDEA-274106 GitOrigin-RevId: 3f41806bc5eceea7efa2c10bc149f231b4d42262
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2f7a5590b8
commit
4bbd7cf012
@@ -0,0 +1,10 @@
|
||||
// "Create local variable 'flag'" "true-preview"
|
||||
class Foo {
|
||||
void test(Object obj) {
|
||||
boolean flag;
|
||||
switch (obj) {
|
||||
case String s && flag -> System.out.println(1);
|
||||
default -> System.out.println(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Create local variable 'flag'" "true-preview"
|
||||
class Foo {
|
||||
void test(Object obj) {
|
||||
boolean flag;
|
||||
switch (obj) {
|
||||
case String s when flag -> System.out.println(1);
|
||||
default -> System.out.println(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create local variable 'flag'" "true-preview"
|
||||
class Foo {
|
||||
void test(Object obj) {
|
||||
switch (obj) {
|
||||
case String s && flag<caret> -> System.out.println(1);
|
||||
default -> System.out.println(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create local variable 'flag'" "true-preview"
|
||||
class Foo {
|
||||
void test(Object obj) {
|
||||
switch (obj) {
|
||||
case String s when flag<caret> -> System.out.println(1);
|
||||
default -> System.out.println(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user