mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
testdata for IDEA-60836
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
import java.util.*;
|
||||
public class IdeaGenericsTest {
|
||||
interface Animal<T extends Animal<T>> {
|
||||
List<T> getFriends();
|
||||
}
|
||||
|
||||
class Dog implements Animal<Dog> {
|
||||
public List<Dog> getFriends() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Cat implements Animal<Cat> {
|
||||
public List<Cat> getFriends() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void mixAnimals() {
|
||||
ArrayList<Dog> dogs = null;
|
||||
ArrayList<Cat> cats = null;
|
||||
|
||||
<error descr="Inferred type 'java.util.ArrayList<IdeaGenericsTest.Dog>' for type parameter 'V' is not within its bound; should extend 'java.util.ArrayList<IdeaGenericsTest.Cat>'">makeFriends(cats, dogs)</error>;
|
||||
}
|
||||
|
||||
private<T extends Animal<T>, V extends ArrayList<T>> void makeFriends(ArrayList<T> someAnimals, V otherAnimals) {
|
||||
someAnimals.add(otherAnimals.get(0));
|
||||
}
|
||||
}
|
||||
@@ -326,6 +326,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA114894() { doTest5(false); }
|
||||
public void testIDEA60818() { doTest5(false); }
|
||||
public void testIDEA63331() { doTest5(false); }
|
||||
public void testIDEA60836() { doTest5(false); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user