JVM: Mark suspend lambda receiver as used if callable reference
accesses it. #KT-44131 Fixed
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
// WITH_RUNTIME
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun box(): String = a { (::write)() }
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {})
|
||||
}
|
||||
|
||||
fun a(a: suspend Writer.() -> String): String {
|
||||
var res = ""
|
||||
builder { res = Writer().a() }
|
||||
return res
|
||||
}
|
||||
|
||||
class Writer {
|
||||
fun write(): String = "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user