[java-highlighting] InstanceOfNameConflicts: new test

GitOrigin-RevId: c766833dd6ff293c807838ccf94fe9a416361206
This commit is contained in:
Tagir Valeev
2021-01-29 10:04:35 +07:00
committed by intellij-monorepo-bot
parent d3443e5f2b
commit 0a1276cbe2

View File

@@ -22,6 +22,11 @@ class X {
boolean b6 = !(o1 instanceof String s1) ? o2 instanceof String s : o3 instanceof String <error descr="Variable 's' is already defined in the scope">s</error>;
}
void ternary2(Object o) {
boolean b1 = (o instanceof String a) ? false : (o instanceof String <error descr="Variable 'a' is already defined in the scope">a</error>);
boolean b2 = (o instanceof String a) ? false : ((o instanceof String a) ? false : true);
}
void ifElse(Object o1, Object o2) {
if (o1 instanceof String s) {
if (o2 instanceof String <error descr="Variable 's' is already defined in the scope">s</error>) {