Files
kotlin/compiler/testData/codegen/boxWithStdlib/reflection/call/platformStatic.kt
Alexander Udalov ced1edcf98 Prohibit callable references to object members
To be able to make them more useful in the future, i.e. bound to the object
instance
2015-10-14 20:45:56 +03:00

18 lines
331 B
Kotlin
Vendored

import kotlin.jvm.JvmStatic as static
object Obj {
@static fun foo() {}
}
class C {
companion object {
@static fun bar() {}
}
}
fun box(): String {
(Obj::class.members.single { it.name == "foo" }).call(Obj)
(C.Companion::class.members.single { it.name == "bar" }).call(C.Companion)
return "OK"
}