Deprecate PropertyMetadata, use KProperty<*> for delegated properties instead
This commit is contained in:
+6
-4
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user