Minor, move tests under common directory

This commit is contained in:
Alexander Udalov
2015-02-11 00:01:02 +03:00
parent 32c371dd41
commit c417d984c4
17 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
class C {
class D {
fun foo(): Any {
return {}
}
}
}
fun box(): String {
val javaClass = C.D().foo().javaClass
val enclosingMethod = javaClass.getEnclosingMethod()
if (enclosingMethod?.getName() != "foo") return "method: $enclosingMethod"
val enclosingClass = javaClass.getEnclosingClass()
if (enclosingClass?.getSimpleName() != "D") return "enclosing class: $enclosingClass"
val declaringClass = javaClass.getDeclaringClass()
if (declaringClass != null) return "anonymous function has a declaring class: $declaringClass"
return "OK"
}