Rename KClass.properties and extensionProperties: prepend 'member'
To better emphasize the fact that all returned properties require an instance of the class they are declared in. Another issue was that 'Some::class.extensionProperties' was sometimes incorrectly perceived as "get all extension properties available on the class Some"
This commit is contained in:
+2
-2
@@ -7,10 +7,10 @@ open class Super(val r: String)
|
||||
class Sub(r: String) : Super(r)
|
||||
|
||||
fun box(): String {
|
||||
val props = javaClass<Sub>().kotlin.declaredProperties
|
||||
val props = javaClass<Sub>().kotlin.declaredMemberProperties
|
||||
if (!props.isEmpty()) return "Fail $props"
|
||||
|
||||
val allProps = javaClass<Sub>().kotlin.properties
|
||||
val allProps = javaClass<Sub>().kotlin.memberProperties
|
||||
assertEquals(listOf("r"), allProps.map { it.name })
|
||||
return allProps.single().get(Sub("OK")) as String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user