Files
kotlin-fork/compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInSuspendLambda.kt
T
2021-09-10 16:29:16 +03:00

18 lines
425 B
Kotlin
Vendored

// !OPT_IN: kotlin.reflect.jvm.ExperimentalReflectionOnLambdas
// TARGET_BACKEND: JVM
// WITH_REFLECT
// WITH_COROUTINES
// FILE: a.kt
import helpers.*
import kotlin.coroutines.*
import kotlin.reflect.jvm.reflect
fun box(): String {
lateinit var x: (String) -> Unit
suspend {
x = { OK: String -> }
}.startCoroutine(EmptyContinuation)
return x.reflect()?.parameters?.singleOrNull()?.name ?: "null"
}