Don't generate implicit overrides delegating to Java defaults

#KT-40920 Fixed
This commit is contained in:
Mikhael Bogdanov
2020-08-10 12:24:54 +02:00
parent 07aee8831e
commit 607f99ed3c
11 changed files with 339 additions and 2 deletions
+28
View File
@@ -0,0 +1,28 @@
// !JVM_DEFAULT_MODE: enable
// TARGET_BACKEND: JVM
// FILE: JBase.java
public interface JBase extends Base {
default String test() {
return "OK";
}
}
// FILE: main.kt
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface Base {
@JvmDefault
fun test(): String = "Base"
}
interface LeftBase : Base
interface Right : JBase
interface Child : LeftBase, Right
fun box(): String {
return object : Child {}.test()
}
@@ -0,0 +1,27 @@
// !JVM_DEFAULT_MODE: all
// TARGET_BACKEND: JVM
// FILE: JBase.java
public interface JBase extends Base {
default String test() {
return "OK";
}
}
// FILE: main.kt
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface Base {
fun test(): String = "Base"
}
interface LeftBase : Base
interface Right : JBase
interface Child : LeftBase, Right
fun box(): String {
return object : Child {}.test()
}