mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 13:39:36 +07:00
[java-intentions] Test for intention on guard type mismatch
GitOrigin-RevId: b34a0cd0671483151e4db2e0c14df115d471e108
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b0d19b0fc2
commit
e4d0585b15
@@ -0,0 +1,13 @@
|
||||
// "Wrap using 'Boolean.parseBoolean()'" "true-preview"
|
||||
public class TestGuard {
|
||||
public void ahem(Object obj) {
|
||||
switch(obj) {
|
||||
case String s when Boolean.parseBoolean(foo(s)) -> {}
|
||||
default -> {}
|
||||
}
|
||||
}
|
||||
|
||||
private String foo(String s) {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Wrap using 'Boolean.parseBoolean()'" "true-preview"
|
||||
public class TestGuard {
|
||||
public void ahem(Object obj) {
|
||||
switch(obj) {
|
||||
case String s when <caret>foo(s) -> {}
|
||||
default -> {}
|
||||
}
|
||||
}
|
||||
|
||||
private String foo(String s) {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user