Replace get() and set() to getValue() and setValue() (property delegates)

This commit is contained in:
Yan Zhulanow
2015-10-05 20:18:58 +03:00
parent 2fee9d362c
commit 1f2b4e20fe
295 changed files with 718 additions and 511 deletions
@@ -5,5 +5,5 @@ class B<T> {
fun <S> x (y: B<Iterable<S>>) {
val z: S = y[""] // does not work with [], but works with .get()
}
operator fun <S> get(s : String): S = throw Exception()
operator fun <S> get(<!UNUSED_PARAMETER!>s<!> : String): S = throw Exception()
}
@@ -8,4 +8,4 @@ class F<T> {
val z: ArrayList<T> = y["", w]
}
}
operator fun <V, T> Any.get(s: String, w: ArrayList<V>): ArrayList<T> = throw Exception()
operator fun <V, T> Any.get(<!UNUSED_PARAMETER!>s<!>: String, <!UNUSED_PARAMETER!>w<!>: ArrayList<V>): ArrayList<T> = throw Exception()
@@ -5,8 +5,8 @@ class A(val map: MutableMap<String, CharSequence>) {
var a: String by map.withDefault1 { "foo" }
}
fun <G> MutableMap<in String, in G>.get(thisRef: Any?, property: PropertyMetadata): G = throw Exception()
fun <G> MutableMap<in String, in G>.getValue(thisRef: Any?, property: PropertyMetadata): G = throw Exception()
fun <S> MutableMap<in String, in S>.set(thisRef: Any?, property: PropertyMetadata, value: S) {}
fun <S> MutableMap<in String, in S>.setValue(thisRef: Any?, property: PropertyMetadata, value: S) {}
fun <K, V> MutableMap<K, V>.withDefault1(default: (key: K) -> V): MutableMap<K, V> = this
@@ -1,7 +1,7 @@
package
public fun </*0*/ G> kotlin.MutableMap<in kotlin.String, in G>.get(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.PropertyMetadata): G
public fun </*0*/ S> kotlin.MutableMap<in kotlin.String, in S>.set(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.PropertyMetadata, /*2*/ value: S): kotlin.Unit
public fun </*0*/ G> kotlin.MutableMap<in kotlin.String, in G>.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.PropertyMetadata): G
public fun </*0*/ S> kotlin.MutableMap<in kotlin.String, in S>.setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.PropertyMetadata, /*2*/ value: S): kotlin.Unit
public fun </*0*/ K, /*1*/ V> kotlin.MutableMap<K, V>.withDefault1(/*0*/ default: (K) -> V): kotlin.MutableMap<K, V>
public final class A {