Support restricted suspend lambdas in JVM_IR
#KT-40135 Fixed
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// WITH_RUNTIME
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
import kotlin.coroutines.*
|
||||
|
||||
@RestrictsSuspension
|
||||
interface Marker {
|
||||
fun restricted()
|
||||
}
|
||||
|
||||
var lambda: Any? = null
|
||||
|
||||
fun acceptsRestricted(c: suspend Marker.() -> Unit) {
|
||||
lambda = c
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
acceptsRestricted {}
|
||||
@Suppress("INVISIBLE_REFERENCE")
|
||||
return if (lambda is kotlin.coroutines.jvm.internal.RestrictedSuspendLambda) "OK"
|
||||
else "FAIL"
|
||||
}
|
||||
Reference in New Issue
Block a user