mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
new inference: pull erased flag through nested calls (IDEA-133613)
This commit is contained in:
@@ -1810,4 +1810,8 @@ public class InferenceSession {
|
||||
public List<String> getIncompatibleErrorMessages() {
|
||||
return myErrorMessages;
|
||||
}
|
||||
|
||||
public boolean isErased() {
|
||||
return myErased;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,14 @@ public class ExpressionCompatibilityConstraint extends InputOutputConstraintForm
|
||||
return false;
|
||||
}
|
||||
|
||||
if (exprType instanceof PsiClassType && ((PsiClassType)exprType).resolve() == null) {
|
||||
return true;
|
||||
if (exprType instanceof PsiClassType) {
|
||||
if (((PsiClassType)exprType).resolve() == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (((PsiClassType)exprType).isRaw()) {
|
||||
session.setErased();
|
||||
}
|
||||
}
|
||||
|
||||
if (exprType != null && exprType != PsiType.NULL) {
|
||||
@@ -94,6 +100,9 @@ public class ExpressionCompatibilityConstraint extends InputOutputConstraintForm
|
||||
if (callSession != session) {
|
||||
session.getInferenceSessionContainer().registerNestedSession(callSession);
|
||||
session.propagateVariables(callSession.getInferenceVariables());
|
||||
if (callSession.isErased()) {
|
||||
session.setErased();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import java.util.List;
|
||||
|
||||
class Temp<K> {
|
||||
|
||||
public static List<String> foo() {
|
||||
return parallelizePairs(asList(new Tuple())).partitionBy();
|
||||
}
|
||||
|
||||
public static <T> List<T> asList(T a) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <K> Temp<K> parallelizePairs(List<Tuple<K>> list) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<K> partitionBy() { return null; }
|
||||
}
|
||||
|
||||
class Tuple<A> {
|
||||
public Tuple() {}
|
||||
}
|
||||
@@ -351,6 +351,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPullUncheckedWarningNotionThroughNestedCalls() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user