Test for KT-5969: Codegen overrides all java 8 default methods with delegation to unexisting Timpl
#KT-5969 Fixed
This commit is contained in:
+6
@@ -47,6 +47,12 @@ public class BlackBoxWithJava8CodegenTestGenerated extends AbstractBlackBoxCodeg
|
||||
doTestWithJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("dontDelegateToDefaultMethods")
|
||||
public void testDontDelegateToDefaultMethods() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/java8/boxWithJava/dontDelegateToDefaultMethods/");
|
||||
doTestWithJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("samOnInterfaceWithDefaultMethod")
|
||||
public void testSamOnInterfaceWithDefaultMethod() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/java8/boxWithJava/samOnInterfaceWithDefaultMethod/");
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
interface Test<T> {
|
||||
|
||||
T call();
|
||||
|
||||
default T testDefault(T p) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Child : Test<String> {
|
||||
override fun call() : String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
fun box(): String {
|
||||
val res = Child().call()
|
||||
if (res != "OK") return "fail $res"
|
||||
|
||||
return Child().testDefault("OK")
|
||||
}
|
||||
Reference in New Issue
Block a user