Support reflection tests on Android

This commit is contained in:
Mikhael Bogdanov
2019-01-22 17:48:45 +01:00
parent 91980c5293
commit f2a51d3b80
49 changed files with 235 additions and 174 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// WITH_RUNTIME
object Obj {
class Inner() {
@@ -9,7 +10,7 @@ object Obj {
}
fun box() : String {
val klass = Class.forName("Obj\$Inner")!!
val klass = Obj.Inner::class.java
val cons = klass.getConstructors()!![0]
val inner = cons.newInstance(*(arrayOfNulls<String>(0) as Array<String>))
return "OK"