mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
new overload resolution: covariant comparison of return types
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
class Test {
|
||||
interface I { Object invoke(); }
|
||||
interface IStr { String foo(); }
|
||||
|
||||
private static void call(IStr str) {
|
||||
System.out.println(str);
|
||||
}
|
||||
|
||||
private static void <warning descr="Private method 'call(Test.I)' is never used">call</warning>(I i) {
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
call(()-> null);
|
||||
}
|
||||
}
|
||||
+4
@@ -79,6 +79,10 @@ public class MostSpecificResolutionTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testMostSpecificByReturnType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user