unrelated defaults: don't check type parameters

This commit is contained in:
Anna Kozlova
2016-03-11 09:38:32 +01:00
parent 2bc9f279ff
commit 9675e0248a
3 changed files with 19 additions and 0 deletions
@@ -442,6 +442,7 @@ public class GenericsHighlightUtil {
static HighlightInfo checkUnrelatedDefaultMethods(@NotNull PsiClass aClass,
@NotNull PsiIdentifier classIdentifier) {
if (aClass instanceof PsiTypeParameter) return null;
final Map<MethodSignature, Set<PsiMethod>> overrideEquivalent =
new THashMap<MethodSignature, Set<PsiMethod>>(MethodSignatureUtil.METHOD_PARAMETERS_ERASURE_EQUALITY);
PsiClass[] supers = aClass.getSupers();
@@ -0,0 +1,14 @@
interface A {
default void f(){}
}
interface B extends A {
void f();
}
interface C extends A {}
interface D extends C {}
class U {
<T extends B & C> void m (){}
<T extends B & D> void m1(){}
}
@@ -62,6 +62,10 @@ public class Interface8MethodsHighlightingTest extends LightCodeInsightFixtureTe
doTest(false, false);
}
public void testUnrelatedDefaultsWithTypeParameter() throws Exception {
doTest(false, false);
}
public void testStaticMethodAccessibleBothThroughStaticImportAndInheritance() throws Exception {
myFixture.addClass("package p; public interface Foo {" +
" static void foo() {}" +