Replace get() and set() to getValue() and setValue() (property delegates)
This commit is contained in:
@@ -4,11 +4,11 @@ class MyClass() {
|
||||
}
|
||||
|
||||
class Delegate {
|
||||
fun get(t: Any?, p: PropertyMetadata): Int {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
fun set(t: Any?, p: PropertyMetadata, i: Int) {}
|
||||
fun setValue(t: Any?, p: PropertyMetadata, i: Int) {}
|
||||
}
|
||||
|
||||
// TESTED_OBJECT_KIND: function
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
class TestDelegate() {
|
||||
fun get(thisRef: Any?, desc: PropertyMetadata): Int {
|
||||
fun getValue(thisRef: Any?, desc: PropertyMetadata): Int {
|
||||
return 10
|
||||
}
|
||||
|
||||
public open fun set(thisRef: Any?, desc: PropertyMetadata, svalue : Int) {
|
||||
public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : Int) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class TestDelegate() {
|
||||
fun get(thisRef: Any?, desc: PropertyMetadata): Int {
|
||||
fun getValue(thisRef: Any?, desc: PropertyMetadata): Int {
|
||||
return 10
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,14 +1,14 @@
|
||||
public open class TestDelegate<T: Any>(private val initializer: () -> T) {
|
||||
private var value: T? = null
|
||||
|
||||
public open fun get(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
public open fun getValue(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
if (value == null) {
|
||||
value = initializer()
|
||||
}
|
||||
return value!!
|
||||
}
|
||||
|
||||
public open fun set(thisRef: Any?, desc: PropertyMetadata, svalue : T) {
|
||||
public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : T) {
|
||||
value = svalue
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,14 +1,14 @@
|
||||
public open class TestDelegate<T: Any>(private val initializer: () -> T) {
|
||||
private var value: T? = null
|
||||
|
||||
public open fun get(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
public open fun getValue(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
if (value == null) {
|
||||
value = initializer()
|
||||
}
|
||||
return value!!
|
||||
}
|
||||
|
||||
public open fun set(thisRef: Any?, desc: PropertyMetadata, svalue : T) {
|
||||
public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : T) {
|
||||
value = svalue
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
class TestDelegate() {
|
||||
fun get(thisRef: Any?, desc: PropertyMetadata): Int {
|
||||
fun getValue(thisRef: Any?, desc: PropertyMetadata): Int {
|
||||
return 10
|
||||
}
|
||||
|
||||
public open fun set(thisRef: Any?, desc: PropertyMetadata, svalue : Int) {
|
||||
public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : Int) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class TestDelegate() {
|
||||
fun get(thisRef: Any?, desc: PropertyMetadata): Int {
|
||||
fun getValue(thisRef: Any?, desc: PropertyMetadata): Int {
|
||||
return 10
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user