fix for default overriding abstract: missed substitutor

This commit is contained in:
Anna Kozlova
2016-02-26 15:07:50 +01:00
parent 9570f886c1
commit cbd7853f19
3 changed files with 16 additions and 1 deletions

View File

@@ -502,7 +502,7 @@ public class GenericsHighlightUtil {
if (unrelatedMethodContainingClass == null) continue;
if (!aClass.hasModifierProperty(PsiModifier.ABSTRACT) && astracts != null && unrelatedMethodContainingClass.isInterface()) {
if (defaultMethodContainingClass.isInheritor(unrelatedMethodContainingClass, true) &&
MethodSignatureUtil.isSubsignature(unrelatedMethod.getSignature(PsiSubstitutor.EMPTY),
MethodSignatureUtil.isSubsignature(unrelatedMethod.getSignature(TypeConversionUtil.getSuperClassSubstitutor(unrelatedMethodContainingClass, defaultMethodContainingClass, PsiSubstitutor.EMPTY)),
defaultMethod.getSignature(PsiSubstitutor.EMPTY))) {
continue;
}

View File

@@ -0,0 +1,14 @@
import java.util.function.Consumer;
class Test {
interface IOfInt extends Consumer<Integer> {
default void accept(Integer i) {}
}
interface TS<T> extends Consumer<T> {}
interface TS1<T> extends TS<T> {}
class OfInt implements TS<Integer>, IOfInt {}
class OfInt1 implements Consumer<Integer>, IOfInt {}
class OfInt2 implements TS<Integer>, IOfInt {}
}

View File

@@ -36,6 +36,7 @@ public class Interface8MethodsHighlightingTest extends LightCodeInsightFixtureTe
public void testStaticMethodCalls() { doTest(false, false); }
public void testStaticMethodCallsAndOverloadResolution() { doTest(false, false); }
public void testDefaultMethodOverrideEquivalentObject() { doTest(false, false); }
public void testDefaultMethodOverrideAbstract() { doTest(false, false); }
public void testModifierNativeInInterface() { doTest(false, false); }
public void testStaticMethods() { doTest(false, false); }
public void testFinalStaticDefaultMethods() { doTest(false, false); }