Files
kotlin-fork/compiler/testData/codegen/boxWithStdlib/reflection/enclosing/lambdaInPropertyGetter.kt
T
Dmitry Petrov a47eaa2cb5 Change part class naming scheme
update tests depending on part class naming
2015-09-07 16:28:42 +03:00

17 lines
529 B
Kotlin
Vendored

val l: Any
get() = {}
fun box(): String {
val enclosingMethod = l.javaClass.getEnclosingMethod()
if (enclosingMethod?.getName() != "getL") return "method: $enclosingMethod"
val enclosingClass = l.javaClass.getEnclosingClass()!!.getName()
if (enclosingClass != "LambdaInPropertyGetterKt") return "enclosing class: $enclosingClass"
val declaringClass = l.javaClass.getDeclaringClass()
if (declaringClass != null) return "anonymous function has a declaring class: $declaringClass"
return "OK"
}