getValue()/setValue() should be marked with 'operator'

This commit is contained in:
Yan Zhulanow
2015-10-12 01:59:40 +03:00
parent bc3d1ddda0
commit dc8e796e49
121 changed files with 242 additions and 231 deletions
@@ -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 {