Generate correct $default method for actual suspend function

In order to do this, we need to get initial expect suspend function
before generating default value parameters checks.
 #KT-43587 Fixed
This commit is contained in:
Ilmir Usmanov
2020-12-07 08:55:28 +01:00
parent 0dc5f3ac00
commit 7f51f57998
9 changed files with 66 additions and 1 deletions
@@ -0,0 +1,25 @@
// !LANGUAGE: +MultiPlatformProjects
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
// IGNORE_BACKEND_FIR: JVM_IR
import kotlin.coroutines.*
var res = 0L
expect suspend fun withLimit(limit: Long = 42L)
actual suspend fun withLimit(limit: Long) {
res = limit
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(Continuation(EmptyCoroutineContext) {})
}
fun box(): String {
builder {
withLimit()
}
return if (res == 42L) "OK" else "FAIL $res"
}