eleminate wildcards in extends/implements lists (IDEA-82093)

This commit is contained in:
Anna Kozlova
2013-06-04 12:16:11 +04:00
parent 99e910365b
commit 69880fdbb6
3 changed files with 37 additions and 1 deletions

View File

@@ -51,7 +51,7 @@ public class ExtendsListFix extends LocalQuickFixAndIntentionActionOnPsiElement
super(aClass);
myClassToExtendFrom = classToExtendFrom;
myToAdd = toAdd;
myTypeToExtendFrom = typeToExtendFrom;
myTypeToExtendFrom = (PsiClassType)GenericsUtil.eliminateWildcards(typeToExtendFrom);
@NonNls final String messageKey;
if (classToExtendFrom != null && aClass.isInterface() == classToExtendFrom.isInterface()) {

View File

@@ -0,0 +1,20 @@
// "Make 'a' implement 'b'" "true"
interface b<T> {
void f(T t);
}
class a implements b<Integer> {
public void f(Integer integer) {
}
}
class X {
void h(b<? super Integer> i) {
}
void g() {
h(new a());
}
}

View File

@@ -0,0 +1,16 @@
// "Make 'a' implement 'b'" "true"
interface b<T> {
void f(T t);
}
class a {}
class X {
void h(b<? super Integer> i) {
}
void g() {
h(new a<caret>());
}
}