Add 'val KClass.declaredProperties', make getProperties a property

This commit is contained in:
Alexander Udalov
2015-03-16 16:14:32 +03:00
parent 4a61f2751c
commit d3abd54b06
14 changed files with 107 additions and 48 deletions
@@ -6,7 +6,7 @@ class A(val readonly: String) {
}
fun box(): String {
val props = javaClass<A>().kotlin.getProperties()
val props = javaClass<A>().kotlin.properties
val readonly = props.single { it.name == "readonly" }
assert(readonly !is KMutableMemberProperty<A, *>) { "Fail 1: $readonly" }
val mutable = props.single { it.name == "mutable" }