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
@@ -0,0 +1,21 @@
open class C(val a: Any)
fun box(): String {
val l = object : C({}) {
}
val javaClass = l.a.javaClass
if (javaClass.getEnclosingConstructor() != null) return "ctor should be null"
val enclosingMethod = javaClass.getEnclosingMethod()!!.getName()
if (enclosingMethod != "box") return "method: $enclosingMethod"
val enclosingClass = javaClass.getEnclosingClass()!!.getName()
if (!enclosingClass.startsWith("_DefaultPackage\$") || enclosingClass != l.javaClass.getEnclosingClass()!!.getName())
return "enclosing class: $enclosingClass"
val declaringClass = javaClass.getDeclaringClass()
if (declaringClass != null) return "anonymous function has a declaring class: $declaringClass"
return "OK"
}