Generate stubs for private function with default arguments as public in interfaces

This commit is contained in:
Mikhael Bogdanov
2021-03-09 07:12:10 +01:00
committed by Space
parent 7edbf79b4b
commit f648d86d2b
13 changed files with 371 additions and 4 deletions
@@ -0,0 +1,40 @@
// CHECK_BYTECODE_LISTING
// !JVM_DEFAULT_MODE: all-compatibility
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// WITH_COROUTINES
// WITH_RUNTIME
// IGNORE_BACKEND: JVM
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
interface Foo {
fun bar(): String {
var result = "fail"
builder {
result = fooSuspend()
}
return foo() + result
}
private fun foo(s: String = "O"): String {
return s
}
private suspend fun fooSuspend(s: String = "K"): String {
return s
}
}
fun box(): String {
return object : Foo {}.bar()
}