Do not generate $suspendImpl for JvmDefault functions in interfaces
#KT-44533 Fixed
This commit is contained in:
+38
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user