Files
openide/java/java-tests/testData/inspection/patternVariableCanBeUsed/beforePatternVariableExists.java
Tagir Valeev e02acc6581 [java-inspections] IDEA-265512 Local variable is redundant is not highlighted when pattern is used
GitOrigin-RevId: 7b3919db8b74de179e5fd33e02fa29071f5d3fe6
2021-04-27 14:42:09 +00:00

14 lines
300 B
Java

// "Replace 'ts' with existing pattern variable 'i1'" "true"
import java.util.*;
class Test {
interface T {}
HashSet<T> test(Iterable<T> i) {
if (i instanceof Collection<T> i1) {
Collection<T> t<caret>s = (Collection<T>) i;
return new HashSet<>(ts);
}
return null;
}
}