mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: accept raw equality
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ public class TypeEqualityConstraint implements ConstraintFormula {
|
||||
|
||||
if (session.isProperType(myT) && session.isProperType(myS)) {
|
||||
if (myT == null) return myS == null || myS.equalsToText(CommonClassNames.JAVA_LANG_OBJECT);
|
||||
if (myS == null) return myT.equalsToText(CommonClassNames.JAVA_LANG_OBJECT);
|
||||
if (myS == null) return true;
|
||||
return Comparing.equal(myT, myS);
|
||||
}
|
||||
InferenceVariable inferenceVariable = session.getInferenceVariable(myS);
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class Foo<T> {
|
||||
|
||||
public void test(Foo parent) {
|
||||
List<Foo> elements = getElements(parent);
|
||||
}
|
||||
|
||||
public static <E extends Foo<E>> List<E> getElements(E parent) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
+4
@@ -180,6 +180,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawTypeFromParent() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user