mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 00:21:35 +00:00
16 lines
553 B
Kotlin
16 lines
553 B
Kotlin
val l: Any
|
|
get() = {}
|
|
|
|
fun box(): String {
|
|
|
|
val enclosingMethod = l.javaClass.getEnclosingMethod()
|
|
if (enclosingMethod?.getName() != "getL") return "method: $enclosingMethod"
|
|
|
|
val enclosingClass = l.javaClass.getEnclosingClass()
|
|
if (!enclosingClass!!.getName().startsWith("_DefaultPackage-lambdaInPropertyGetter-")) return "enclosing class: $enclosingClass"
|
|
|
|
val declaringClass = l.javaClass.getDeclaringClass()
|
|
if (declaringClass != null) return "anonymous function has a declaring class: $declaringClass"
|
|
|
|
return "OK"
|
|
} |