getValue()/setValue() should be marked with 'operator'
This commit is contained in:
+14
-14
@@ -1,33 +1,33 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class CustomDelegate {
|
||||
fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name
|
||||
fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
|
||||
operator fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name
|
||||
operator fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
|
||||
}
|
||||
|
||||
class OkDelegate {
|
||||
fun getValue(thisRef: Any?, prop: PropertyMetadata): String = prop.name
|
||||
fun setValue(thisRef: Any?, prop: PropertyMetadata, value: String) {}
|
||||
operator fun getValue(thisRef: Any?, prop: PropertyMetadata): String = prop.name
|
||||
operator fun setValue(thisRef: Any?, prop: PropertyMetadata, value: String) {}
|
||||
}
|
||||
|
||||
class CustomDelegate2 {
|
||||
fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name
|
||||
fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
|
||||
operator fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name
|
||||
operator fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
|
||||
|
||||
fun getValue(thisRef: Any?, prop: PropertyMetadata): Int = 5
|
||||
fun setValue(thisRef: Any?, prop: PropertyMetadata, value: Int) {}
|
||||
operator fun getValue(thisRef: Any?, prop: PropertyMetadata): Int = 5
|
||||
operator fun setValue(thisRef: Any?, prop: PropertyMetadata, value: Int) {}
|
||||
}
|
||||
|
||||
class CustomDelegate3 {
|
||||
fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name
|
||||
fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
|
||||
operator fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name
|
||||
operator fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
|
||||
}
|
||||
|
||||
fun OkDelegate.get(thisRef: Any?, prop: PropertyMetadata): Int = 4
|
||||
fun OkDelegate.set(thisRef: Any?, prop: PropertyMetadata, value: Int) {}
|
||||
operator fun OkDelegate.get(thisRef: Any?, prop: PropertyMetadata): Int = 4
|
||||
operator fun OkDelegate.set(thisRef: Any?, prop: PropertyMetadata, value: Int) {}
|
||||
|
||||
fun CustomDelegate3.getValue(thisRef: Any?, prop: PropertyMetadata): Int = 4
|
||||
fun CustomDelegate3.setValue(thisRef: Any?, prop: PropertyMetadata, value: Int) {}
|
||||
operator fun CustomDelegate3.getValue(thisRef: Any?, prop: PropertyMetadata): Int = 4
|
||||
operator fun CustomDelegate3.setValue(thisRef: Any?, prop: PropertyMetadata, value: Int) {}
|
||||
|
||||
class Example {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user