mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
revert new inference: mark erased for type params/raw types compatibility (IDEA-126379)
This commit is contained in:
@@ -7,7 +7,11 @@ class Foo<T> {
|
||||
List<Foo> elements = getElements(parent);
|
||||
|
||||
|
||||
for (<error descr="Incompatible types. Found: 'java.lang.Object', required: 'Foo'">Foo foo : getElements(parent)</error>) {
|
||||
/*for (Foo foo : getElements(parent)) {
|
||||
System.out.println(foo);
|
||||
}*/
|
||||
|
||||
for (Foo foo : getElementsArray(parent)) {
|
||||
System.out.println(foo);
|
||||
}
|
||||
}
|
||||
@@ -15,4 +19,8 @@ class Foo<T> {
|
||||
public static <E extends Foo<E>> List<E> getElements(E parent) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public static <E extends Foo<E>> E[] getElementsArray(E parent) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
protected Class[] getAllInterfaces(final Set<Class> interfaces, final Class[] classes) {
|
||||
return interfaces.toArray(classes);
|
||||
}
|
||||
public static <T extends Collection<String>> T get(T out) {
|
||||
return out;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Set<String> set = get(new HashSet());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user