mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-11-13 00:33:59 +07:00
[java][instanceof] IDEA-280626 Patterns in instanceof: red code false-negative
Move the test data to LightPatternsHighlightingTest Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: f62fc31839e92b03161837d92b2518c4b13ab5c8
This commit is contained in:
1 parent
2e1608914a
commit
cbb421ecb6
3 files changed
+28
-22
No files matched your search
+24
@@ -0,0 +1,24 @@
|
||||
|
||||
class Main {
|
||||
|
||||
private static final boolean TRUE = 1 == 1;
|
||||
|
||||
void testGuardedPatternWithCompileTimeCondition1(String s) {
|
||||
if (s instanceof (<error descr="Pattern type 'String' is the same as expression type">String</error> s1 && true)) {
|
||||
System.out.println(s1);
|
||||
}
|
||||
}
|
||||
|
||||
void testGuardedPatternWithAlwaysTrueCondition2(String s) {
|
||||
if (s instanceof (<error descr="Pattern type 'String' is the same as expression type">String</error> s1 && TRUE)) {
|
||||
System.out.println(s1);
|
||||
}
|
||||
}
|
||||
|
||||
void testGuardedPatternWithAlwaysTrueCondition3(String s) {
|
||||
if (s instanceof ((<error descr="Pattern type 'String' is the same as expression type">String</error> s1 && true) && true)) {
|
||||
System.out.println(s1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user