mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 00:21:28 +00:00
16 lines
415 B
Kotlin
Vendored
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
|
|
}
|