Files
kotlin/compiler/testData/codegen/boxWithStdlib/reflection/properties/fakeOverridesInSubclass.kt
2016-01-22 05:54:38 +03:00

16 lines
415 B
Kotlin
Vendored

import kotlin.reflect.*
import kotlin.test.*
open class Super(val r: String)
class Sub(r: String) : Super(r)
fun box(): String {
val props = Sub::class.java.kotlin.declaredMemberProperties
if (!props.isEmpty()) return "Fail $props"
val allProps = Sub::class.java.kotlin.memberProperties
assertEquals(listOf("r"), allProps.map { it.name })
return allProps.single().get(Sub("OK")) as String
}