Files
kotlin/compiler/testData/codegen/boxWithStdlib/reflection/lambda/lambdaInPropertyGetter.kt
2014-05-26 14:48:37 +04:00

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"
}