Do not generate $suspendImpl for JvmDefault functions in interfaces

#KT-44533 Fixed
This commit is contained in:
Alexander Udalov
2021-01-27 10:10:49 +01:00
parent 5f71cd5476
commit acd8c4503b
8 changed files with 184 additions and 1 deletions
@@ -0,0 +1,38 @@
// !JVM_DEFAULT_MODE: all-compatibility
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// JVM_TARGET: 1.8
// WITH_COROUTINES
// WITH_RUNTIME
import kotlin.coroutines.*
import helpers.*
interface S {
suspend fun foo()
}
interface T : S {
override suspend fun foo() {
bar()
}
fun bar()
}
object O : T {
var result = ""
override fun bar() {
result = "OK"
}
}
fun builder(block: suspend () -> Unit) {
block.startCoroutine(EmptyContinuation)
}
fun box(): String {
builder { O.foo() }
return O.result
}