Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/NotInferredVarShouldNotBeUsedForInferenceJava10.java
Anna.Kozlova 8db821428d lvti: special highlight for self referencing variables (IDEA-224449)
assume that null as type of the left side of the assignment is not possible

GitOrigin-RevId: c407cdc11e991c8db24ffd683f3b8ea883d41244
2019-10-09 10:32:32 +00:00

18 lines
564 B
Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
class MyTest {
public List<Integer> someMethod() {
<error descr="Cannot infer type: 'var' on variable without initializer">var</error> listOfInteger;
Integer[] arrayOfInteger = {2, 4, 8};
listOfInteger = Arrays.stream(arrayOfInteger)
.filter(number -> number >= 4)
.collect(Collectors.toCollection(ArrayList::new));
return listOfInteger;
}
}