Support jvm default methods in IR

Fix several bugs around DefaultImpls
This commit is contained in:
Mikhail Bogdanov
2020-03-29 12:52:29 +02:00
parent e45a892499
commit b787c8c011
26 changed files with 373 additions and 53 deletions
@@ -1,5 +1,4 @@
// !JVM_DEFAULT_MODE: all-compatibility
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FULL_JDK
// WITH_RUNTIME
@@ -1,5 +1,4 @@
// !JVM_DEFAULT_MODE: all-compatibility
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// WITH_RUNTIME
@@ -1,5 +1,4 @@
// !JVM_DEFAULT_MODE: all-compatibility
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FILE: Simple.java
@@ -0,0 +1,24 @@
// !JVM_DEFAULT_MODE: all-compatibility
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface Z<T> {
fun test(p: T): T {
return p
}
}
open class ZImpl : Z<String>
class ZImpl2 : ZImpl() {
override fun test(p: String): String {
return super.test(p)
}
}
fun box(): String {
return ZImpl2().test("OK")
}
@@ -0,0 +1,26 @@
// !JVM_DEFAULT_MODE: all-compatibility
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface Z<T> {
fun test(p: T): T {
return p
}
}
open class ZImpl : Z<String>
open class ZImpl2 : Z<String>, ZImpl()
class ZImpl3 : ZImpl2() {
override fun test(p: String): String {
return super.test(p)
}
}
fun box(): String {
return ZImpl3().test("OK")
}
@@ -1,5 +1,4 @@
// !JVM_DEFAULT_MODE: all-compatibility
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// WITH_RUNTIME
@@ -1,5 +1,4 @@
// !JVM_DEFAULT_MODE: all-compatibility
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FILE: Simple.java