new inference: accept raw equality

This commit is contained in:
Anna Kozlova
2014-05-30 23:31:18 +04:00
parent 67daae0c20
commit a2615d0fc1
3 changed files with 18 additions and 1 deletions
@@ -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);
@@ -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<>();
}
}
@@ -180,6 +180,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
doTest();
}
public void testRawTypeFromParent() throws Exception {
doTest();
}
private void doTest() throws Exception {
doTest(false);
}