[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:
Nikita Eshkeev authored and intellij-monorepo-bot committed 2021-10-27 10:47:22 +00:00
1 parent 2e1608914a
commit cbb421ecb6
3 files changed
+28 -22

No files matched your search

@@ -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);
}
}
}