mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 07:40:42 +07:00
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:
committed by
intellij-monorepo-bot
parent
e819ba58d4
commit
8db821428d
+1
-1
@@ -9,7 +9,7 @@ class Main {
|
||||
var d2 = new int[4];
|
||||
<error descr="Cannot infer type: 'var' on variable without initializer">var</error> e;
|
||||
var f = <error descr="Array initializer is not allowed here">{ 6 }</error>;
|
||||
var g = (<error descr="Incompatible types. Found: 'int', required: 'null'">g = 7</error>);
|
||||
<error descr="Cannot infer type: variable initializer is self-referencing">var</error> g = (g = 7);
|
||||
}
|
||||
|
||||
private static void localVariableType() {
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user