Deprecate PropertyMetadata, use KProperty<*> for delegated properties instead

This commit is contained in:
Alexander Udalov
2015-10-12 21:42:18 +03:00
parent 3c74f48f91
commit ec1b4776fe
145 changed files with 536 additions and 379 deletions
@@ -1,11 +1,13 @@
package foo
import kotlin.reflect.KProperty
class A1 {
val a: String by MyProperty1()
}
class MyProperty1 {}
operator fun MyProperty1.getValue(thisRef: Any?, desc: PropertyMetadata): String {
operator fun MyProperty1.getValue(thisRef: Any?, desc: KProperty<*>): String {
throw Exception("$thisRef $desc")
}
@@ -16,7 +18,7 @@ class A2 {
}
class MyProperty2<T> {}
operator fun <T> MyProperty2<T>.getValue(thisRef: Any?, desc: PropertyMetadata): T {
operator fun <T> MyProperty2<T>.getValue(thisRef: Any?, desc: KProperty<*>): T {
throw Exception("$thisRef $desc")
}
@@ -27,7 +29,7 @@ class A3 {
class MyProperty3<T> {}
operator fun <T> MyProperty3<T>.getValue(thisRef: Any?, desc: PropertyMetadata): T {
operator fun <T> MyProperty3<T>.getValue(thisRef: Any?, desc: KProperty<*>): T {
throw Exception("$thisRef $desc")
}
}
}