Files
kotlin-fork/compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInArrayConstructor.kt
T
Alexander Udalov fc36178f3a Annotate kotlin.reflect.jvm.reflect with ExperimentalReflectionOnLambdas
This function was always experimental, as explained in its kdoc, but it
was introduced before opt-in requirement markers were supported. Thus,
breaking changes (such as in KT-42746) were always expected, and the
`@ExperimentalReflectionOnLambdas` annotation just makes it clearer.

 #KT-45486 Fixed
2021-03-15 15:54:31 +01:00

14 lines
300 B
Kotlin
Vendored

// !USE_EXPERIMENTAL: kotlin.reflect.jvm.ExperimentalReflectionOnLambdas
// TARGET_BACKEND: JVM
// WITH_REFLECT
import kotlin.reflect.jvm.*
import kotlin.test.assertNotNull
fun box(): String {
assertNotNull({}.reflect())
assertNotNull(Array(1) { {} }.single().reflect())
return "OK"
}