Replace get() and set() to getValue() and setValue() (property delegates)
This commit is contained in:
+3
-3
@@ -19,8 +19,8 @@ fun foo(c: Consumer<Int>, p: Producer<Int>, u: Usual<Int>) {
|
||||
|
||||
//Arrays copy example
|
||||
class Array<T>(val length : Int, val t : T) {
|
||||
fun get(index : Int) : T { return t }
|
||||
fun set(index : Int, value : T) { /* ... */ }
|
||||
fun get(<!UNUSED_PARAMETER!>index<!> : Int) : T { return t }
|
||||
fun set(<!UNUSED_PARAMETER!>index<!> : Int, <!UNUSED_PARAMETER!>value<!> : T) { /* ... */ }
|
||||
}
|
||||
|
||||
fun copy1(<!UNUSED_PARAMETER!>from<!> : Array<Any>, <!UNUSED_PARAMETER!>to<!> : Array<Any>) {}
|
||||
@@ -37,4 +37,4 @@ fun f(ints: Array<Int>, any: Array<Any>, numbers: Array<Number>) {
|
||||
copy2(ints, <!TYPE_MISMATCH!>numbers<!>)
|
||||
copy3<Int>(ints, numbers)
|
||||
copy4(ints, numbers) //ok
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user