mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
clashing return type of overriding methods: fix unchecked override comparison (IDEA-166355)
This commit is contained in:
@@ -1350,7 +1350,7 @@ public class HighlightMethodUtil {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (otherSuperMethod.getTypeParameters().length > 0 && JavaGenericsUtil.isRawToGeneric(curType, otherReturnType)) return null;
|
||||
if (otherSuperMethod.getTypeParameters().length > 0 && JavaGenericsUtil.isRawToGeneric(otherReturnType, curType)) return null;
|
||||
}
|
||||
return createIncompatibleReturnTypeMessage(otherSuperMethod, currentMethod, curType, otherReturnType,
|
||||
JavaErrorMessages.message("unrelated.overriding.methods.return.types"), TextRange.EMPTY_RANGE);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
interface X {}
|
||||
|
||||
interface Y extends X {}
|
||||
|
||||
interface A {
|
||||
<T extends X> T get();
|
||||
}
|
||||
|
||||
interface B extends A {
|
||||
@Override
|
||||
Y get();
|
||||
}
|
||||
|
||||
interface C extends B {}
|
||||
@@ -614,4 +614,8 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testErasureOfMethodCallExpressionTypeIfItDoesntDependOnGenericsParameter() throws Exception {
|
||||
doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false);
|
||||
}
|
||||
|
||||
public void testUncheckedConversionInReturnType() throws Exception {
|
||||
doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user