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:
+25
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user