mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: mark erased for type params/raw types compatibility (IDEA-122932)
This commit is contained in:
+2
@@ -75,6 +75,8 @@ public class TypeCompatibilityConstraint implements ConstraintFormula {
|
||||
if (sSubstitutor != null && PsiUtil.isRawSubstitutor(tClass, sSubstitutor)) {
|
||||
return true;
|
||||
}
|
||||
//comment in 18.2.2. Type Compatibility Constraints
|
||||
if (tClass instanceof PsiTypeParameter && ((PsiClassType)s).isRaw()) return true;
|
||||
}
|
||||
}
|
||||
else if (t instanceof PsiArrayType && t.getArrayDimensions() == s.getArrayDimensions()) {
|
||||
|
||||
+5
@@ -5,6 +5,11 @@ class Foo<T> {
|
||||
|
||||
public void test(Foo parent) {
|
||||
List<Foo> elements = getElements(parent);
|
||||
|
||||
|
||||
for (<error descr="Incompatible types. Found: 'java.lang.Object', required: 'Foo'">Foo foo : getElements(parent)</error>) {
|
||||
System.out.println(foo);
|
||||
}
|
||||
}
|
||||
|
||||
public static <E extends Foo<E>> List<E> getElements(E parent) {
|
||||
|
||||
Reference in New Issue
Block a user