Minor, do not use ".java.kotlin" on KClass instances

This commit is contained in:
Alexander Udalov
2017-08-18 14:32:47 +03:00
parent ac1c7d9a6a
commit 593d6b7a95
9 changed files with 13 additions and 15 deletions
@@ -12,13 +12,13 @@ class A {
fun box(): String {
run {
val foo: KProperty1<A, *> = A::class.java.kotlin.memberProperties.single()
val foo: KProperty1<A, *> = A::class.memberProperties.single()
assert(foo.name == "foo") { "Fail name: $foo (${foo.name})" }
assert(foo.get(A()) == "member") { "Fail value: ${foo.get(A())}" }
}
run {
val foo: KProperty2<A, *, *> = A::class.java.kotlin.memberExtensionProperties.single()
val foo: KProperty2<A, *, *> = A::class.memberExtensionProperties.single()
assert(foo.name == "foo") { "Fail name: $foo (${foo.name})" }
foo as KProperty2<A, Unit, *>
assert(foo.get(A(), Unit) == "extension") { "Fail value: ${foo.get(A(), Unit)}" }