cd9209a7ee
Most of these tests check the specific structure of lambdas when they are generated as classes, and they start to fail once invokedynamic lambdas are enabled by default.
25 lines
679 B
Kotlin
Vendored
25 lines
679 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// LAMBDAS: CLASS
|
|
|
|
// has declaring class on Android 4.4
|
|
// IGNORE_BACKEND: ANDROID
|
|
|
|
// WITH_REFLECT
|
|
|
|
val property = fun () {}
|
|
|
|
fun box(): String {
|
|
val javaClass = property.javaClass
|
|
|
|
val enclosingMethod = javaClass.getEnclosingMethod()
|
|
if (enclosingMethod != null) return "method: $enclosingMethod"
|
|
|
|
val enclosingClass = javaClass.getEnclosingClass()!!.getName()
|
|
if (enclosingClass != "FunctionExpressionInPropertyKt") return "enclosing class: $enclosingClass"
|
|
|
|
val declaringClass = javaClass.getDeclaringClass()
|
|
if (declaringClass != null) return "anonymous function has a declaring class: $declaringClass"
|
|
|
|
return "OK"
|
|
}
|