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
This commit is contained in:
Anna.Kozlova
2019-10-09 11:37:00 +02:00
committed by intellij-monorepo-bot
parent e819ba58d4
commit 8db821428d
4 changed files with 12 additions and 4 deletions

View File

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