'createDelegate' operator renamed to 'toDelegateFor'
This commit is contained in:
committed by
Stanislav Erokhin
parent
e2ba288323
commit
2ee31916c7
-32
@@ -1,32 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun createDelegate(x: Any?, p: KProperty<*>) {}
|
||||
|
||||
operator fun Any.createDelegate(x: Any?, p: KProperty<*>) {}
|
||||
|
||||
operator fun Any.createDelegate(x: Any?, p: Any) {}
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Any.createDelegate(x: Any?, p: Int) {}
|
||||
|
||||
class Host1 {
|
||||
operator fun createDelegate(x: Any?, p: KProperty<*>) {}
|
||||
}
|
||||
|
||||
class Host2 {
|
||||
operator fun Any.createDelegate(x: Any?, p: KProperty<*>) {}
|
||||
}
|
||||
|
||||
class Host3 {
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun createDelegate(x: Any?, p: KProperty<*>, foo: Int) {}
|
||||
}
|
||||
|
||||
class Host4 {
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun createDelegate(x: Any?, p: KProperty<*>, foo: Int = 0) {}
|
||||
}
|
||||
|
||||
class Host5 {
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun createDelegate(x: Any?, p: KProperty<*>, vararg foo: Int) {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ class Cell<out V>(val value: V)
|
||||
|
||||
class GenericDelegate<V>(val value: V)
|
||||
|
||||
operator fun <T> T.createDelegate(a: Any?, p: Any?) = GenericDelegate(this)
|
||||
operator fun <T> T.toDelegateFor(a: Any?, p: Any?) = GenericDelegate(this)
|
||||
|
||||
operator fun <W> GenericDelegate<W>.getValue(a: Any?, p: Any?) = Cell(value)
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package
|
||||
public val test1: Cell<kotlin.String>
|
||||
public val test2: Cell<kotlin.Any>
|
||||
public val test3: Cell<kotlin.String>
|
||||
public operator fun </*0*/ T> T.createDelegate(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.Any?): GenericDelegate<T>
|
||||
public operator fun </*0*/ W> GenericDelegate<W>.getValue(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.Any?): Cell<W>
|
||||
public operator fun </*0*/ T> T.toDelegateFor(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.Any?): GenericDelegate<T>
|
||||
|
||||
public final class Cell</*0*/ out V> {
|
||||
public constructor Cell</*0*/ out V>(/*0*/ value: V)
|
||||
+1
-1
@@ -7,7 +7,7 @@ class StringDelegate(val s: String) {
|
||||
}
|
||||
|
||||
// NB no operator
|
||||
fun String.createDelegate(a: Any?, p: KProperty<*>) = StringDelegate(this)
|
||||
fun String.toDelegateFor(a: Any?, p: KProperty<*>) = StringDelegate(this)
|
||||
|
||||
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package
|
||||
public val test1: kotlin.String
|
||||
public val test2: kotlin.Int
|
||||
public val test3: kotlin.String
|
||||
public fun kotlin.String.createDelegate(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): StringDelegate
|
||||
public operator fun kotlin.String.getValue(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String
|
||||
public fun kotlin.String.toDelegateFor(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): StringDelegate
|
||||
|
||||
public final class StringDelegate {
|
||||
public constructor StringDelegate(/*0*/ s: kotlin.String)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
operator fun String.createDelegate(a: Any?, p: KProperty<*>) = this
|
||||
operator fun String.toDelegateFor(a: Any?, p: KProperty<*>) = this
|
||||
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
|
||||
|
||||
val test1: String by "OK"
|
||||
+1
-1
@@ -2,5 +2,5 @@ package
|
||||
|
||||
public val test1: kotlin.String
|
||||
public val test2: kotlin.String
|
||||
public operator fun kotlin.String.createDelegate(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String
|
||||
public operator fun kotlin.String.getValue(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String
|
||||
public operator fun kotlin.String.toDelegateFor(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun toDelegateFor(x: Any?, p: KProperty<*>) {}
|
||||
|
||||
operator fun Any.toDelegateFor(x: Any?, p: KProperty<*>) {}
|
||||
|
||||
operator fun Any.toDelegateFor(x: Any?, p: Any) {}
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Any.toDelegateFor(x: Any?, p: Int) {}
|
||||
|
||||
class Host1 {
|
||||
operator fun toDelegateFor(x: Any?, p: KProperty<*>) {}
|
||||
}
|
||||
|
||||
class Host2 {
|
||||
operator fun Any.toDelegateFor(x: Any?, p: KProperty<*>) {}
|
||||
}
|
||||
|
||||
class Host3 {
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun toDelegateFor(x: Any?, p: KProperty<*>, foo: Int) {}
|
||||
}
|
||||
|
||||
class Host4 {
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun toDelegateFor(x: Any?, p: KProperty<*>, foo: Int = 0) {}
|
||||
}
|
||||
|
||||
class Host5 {
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun toDelegateFor(x: Any?, p: KProperty<*>, vararg foo: Int) {}
|
||||
}
|
||||
|
||||
+9
-9
@@ -1,15 +1,15 @@
|
||||
package
|
||||
|
||||
public operator fun createDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit
|
||||
public operator fun kotlin.Any.createDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.Any): kotlin.Unit
|
||||
public operator fun kotlin.Any.createDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.Int): kotlin.Unit
|
||||
public operator fun kotlin.Any.createDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit
|
||||
public operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit
|
||||
public operator fun kotlin.Any.toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.Any): kotlin.Unit
|
||||
public operator fun kotlin.Any.toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.Int): kotlin.Unit
|
||||
public operator fun kotlin.Any.toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit
|
||||
|
||||
public final class Host1 {
|
||||
public constructor Host1()
|
||||
public final operator fun createDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@@ -18,29 +18,29 @@ public final class Host2 {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public final operator fun kotlin.Any.createDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit
|
||||
public final operator fun kotlin.Any.toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit
|
||||
}
|
||||
|
||||
public final class Host3 {
|
||||
public constructor Host3()
|
||||
public final operator fun createDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ foo: kotlin.Int): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ foo: kotlin.Int): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Host4 {
|
||||
public constructor Host4()
|
||||
public final operator fun createDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ foo: kotlin.Int = ...): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ foo: kotlin.Int = ...): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Host5 {
|
||||
public constructor Host5()
|
||||
public final operator fun createDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ vararg foo: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ vararg foo: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !LANGUAGE: -OperatorCreateDelegate
|
||||
// !LANGUAGE: -OperatorToDelegateFor
|
||||
|
||||
class WrongDelegate(val x: Int) {
|
||||
operator fun getValue(thisRef: Any?, prop: Any): Int = x
|
||||
}
|
||||
|
||||
<!UNSUPPORTED_FEATURE(only available since Kotlin 1.1: operator createDelegate)!>operator<!> fun String.createDelegate(thisRef: Any?, prop: Any) = WrongDelegate(this.length)
|
||||
<!UNSUPPORTED_FEATURE!>operator<!> fun String.toDelegateFor(thisRef: Any?, prop: Any) = WrongDelegate(this.length)
|
||||
|
||||
operator fun String.getValue(thisRef: Any?, prop: Any) = this
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package
|
||||
public val test1: kotlin.String
|
||||
public val test2: kotlin.Int
|
||||
public val test3: kotlin.String
|
||||
public operator fun kotlin.String.createDelegate(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.Any): WrongDelegate
|
||||
public operator fun kotlin.String.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.Any): kotlin.String
|
||||
public operator fun kotlin.String.toDelegateFor(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.Any): WrongDelegate
|
||||
|
||||
public final class WrongDelegate {
|
||||
public constructor WrongDelegate(/*0*/ x: kotlin.Int)
|
||||
Reference in New Issue
Block a user