Deprecate PropertyMetadata, use KProperty<*> for delegated properties instead
This commit is contained in:
Vendored
+5
-3
@@ -1,5 +1,7 @@
|
||||
package baz
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A(outer: Outer) {
|
||||
var i: String by + getMyConcreteProperty()
|
||||
var d: String by getMyConcreteProperty() - 1
|
||||
@@ -21,12 +23,12 @@ fun getMyConcreteProperty() = MyProperty<Any?, String>()
|
||||
|
||||
class MyProperty<R, T> {
|
||||
|
||||
operator fun getValue(thisRef: R, desc: PropertyMetadata): T {
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): T {
|
||||
println("get $thisRef ${desc.name}")
|
||||
return null as T
|
||||
}
|
||||
|
||||
operator fun setValue(thisRef: R, desc: PropertyMetadata, value: T) {
|
||||
operator fun setValue(thisRef: R, desc: KProperty<*>, value: T) {
|
||||
println("set $thisRef ${desc.name} $value")
|
||||
}
|
||||
}
|
||||
@@ -47,4 +49,4 @@ interface Outer {
|
||||
}
|
||||
|
||||
// -----------------
|
||||
fun println(a: Any?) = a
|
||||
fun println(a: Any?) = a
|
||||
|
||||
Vendored
+2
-2
@@ -26,9 +26,9 @@ package baz {
|
||||
public final class MyProperty</*0*/ R, /*1*/ T> {
|
||||
public constructor MyProperty</*0*/ R, /*1*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit
|
||||
public final operator fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>, /*2*/ value: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
+6
-4
@@ -1,11 +1,13 @@
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A1 {
|
||||
val a: String by MyProperty1()
|
||||
}
|
||||
|
||||
class MyProperty1 {}
|
||||
operator fun MyProperty1.getValue(thisRef: Any?, desc: PropertyMetadata): String {
|
||||
operator fun MyProperty1.getValue(thisRef: Any?, desc: KProperty<*>): String {
|
||||
throw Exception("$thisRef $desc")
|
||||
}
|
||||
|
||||
@@ -16,7 +18,7 @@ class A2 {
|
||||
}
|
||||
|
||||
class MyProperty2<T> {}
|
||||
operator fun <T> MyProperty2<T>.getValue(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
operator fun <T> MyProperty2<T>.getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
throw Exception("$thisRef $desc")
|
||||
}
|
||||
|
||||
@@ -27,7 +29,7 @@ class A3 {
|
||||
|
||||
class MyProperty3<T> {}
|
||||
|
||||
operator fun <T> MyProperty3<T>.getValue(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
operator fun <T> MyProperty3<T>.getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
throw Exception("$thisRef $desc")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
package
|
||||
|
||||
package foo {
|
||||
public operator fun foo.MyProperty1.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): kotlin.String
|
||||
public operator fun </*0*/ T> foo.MyProperty2<T>.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public operator fun foo.MyProperty1.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.reflect.KProperty<*>): kotlin.String
|
||||
public operator fun </*0*/ T> foo.MyProperty2<T>.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
|
||||
public final class A1 {
|
||||
public constructor A1()
|
||||
@@ -26,7 +26,7 @@ package foo {
|
||||
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 </*0*/ T> foo.A3.MyProperty3<T>.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun </*0*/ T> foo.A3.MyProperty3<T>.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
|
||||
public final class MyProperty3</*0*/ T> {
|
||||
public constructor MyProperty3</*0*/ T>()
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
open class A {
|
||||
val B.w: Int by <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED!>MyProperty<!>()
|
||||
}
|
||||
@@ -13,7 +15,7 @@ class B {
|
||||
}
|
||||
|
||||
class MyProperty<R : A, T> {
|
||||
operator fun getValue(thisRef: R, desc: PropertyMetadata): T {
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): T {
|
||||
throw Exception("$thisRef $desc")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ package foo {
|
||||
public final class MyProperty</*0*/ R : foo.A, /*1*/ T> {
|
||||
public constructor MyProperty</*0*/ R : foo.A, /*1*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Vendored
+8
-6
@@ -1,24 +1,26 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A<R>() {
|
||||
operator fun <T> getValue(t: Any?, p: PropertyMetadata): T = null!!
|
||||
operator fun <T> setValue(t: Any?, p: PropertyMetadata, x: T) = Unit
|
||||
operator fun <T> getValue(t: Any?, p: KProperty<*>): T = null!!
|
||||
operator fun <T> setValue(t: Any?, p: KProperty<*>, x: T) = Unit
|
||||
}
|
||||
|
||||
var a1: Int by <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>A<!>()
|
||||
var a2: Int by A<String>()
|
||||
|
||||
class B<R>() {
|
||||
operator fun <T> getValue(t: Any?, p: PropertyMetadata): T = null!!
|
||||
operator fun setValue(t: Any?, p: PropertyMetadata, x: R) = Unit
|
||||
operator fun <T> getValue(t: Any?, p: KProperty<*>): T = null!!
|
||||
operator fun setValue(t: Any?, p: KProperty<*>, x: R) = Unit
|
||||
}
|
||||
|
||||
var b1: Int by B()
|
||||
var b2: Int by B<Number>()
|
||||
|
||||
class C<R>() {
|
||||
operator fun getValue(t: Any?, p: PropertyMetadata): R = null!!
|
||||
operator fun <T> setValue(t: Any?, p: PropertyMetadata, x: T) = Unit
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): R = null!!
|
||||
operator fun <T> setValue(t: Any?, p: KProperty<*>, x: T) = Unit
|
||||
}
|
||||
|
||||
var c1: Int by C()
|
||||
|
||||
Vendored
+6
-6
@@ -10,26 +10,26 @@ public var c2: kotlin.Int
|
||||
public final class A</*0*/ R> {
|
||||
public constructor A</*0*/ R>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun </*0*/ T> getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T
|
||||
public final operator fun </*0*/ T> getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun </*0*/ T> setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit
|
||||
public final operator fun </*0*/ T> setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ x: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class B</*0*/ R> {
|
||||
public constructor B</*0*/ R>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun </*0*/ T> getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T
|
||||
public final operator fun </*0*/ T> getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: R): kotlin.Unit
|
||||
public final operator fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ x: R): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class C</*0*/ R> {
|
||||
public constructor C</*0*/ R>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): R
|
||||
public final operator fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): R
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun </*0*/ T> setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit
|
||||
public final operator fun </*0*/ T> setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ x: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
+8
-6
@@ -1,4 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
var a: Int by A()
|
||||
var a1 by <!DELEGATE_SPECIAL_FUNCTION_MISSING, DELEGATE_SPECIAL_FUNCTION_MISSING!>A()<!>
|
||||
|
||||
@@ -8,16 +10,16 @@ val cObj = C()
|
||||
var c: String by cObj
|
||||
|
||||
class A {
|
||||
operator fun <T> getValue(t: Any?, p: PropertyMetadata): T = null!!
|
||||
operator fun <T> setValue(t: Any?, p: PropertyMetadata, x: T) = Unit
|
||||
operator fun <T> getValue(t: Any?, p: KProperty<*>): T = null!!
|
||||
operator fun <T> setValue(t: Any?, p: KProperty<*>, x: T) = Unit
|
||||
}
|
||||
|
||||
class B
|
||||
|
||||
operator fun <T> B.getValue(t: Any?, p: PropertyMetadata): T = null!!
|
||||
operator fun <T> B.setValue(t: Any?, p: PropertyMetadata, x: T) = Unit
|
||||
operator fun <T> B.getValue(t: Any?, p: KProperty<*>): T = null!!
|
||||
operator fun <T> B.setValue(t: Any?, p: KProperty<*>, x: T) = Unit
|
||||
|
||||
class C
|
||||
|
||||
operator inline fun <reified T> C.getValue(t: Any?, p: PropertyMetadata): T = null!!
|
||||
operator inline fun <reified T> C.setValue(t: Any?, p: PropertyMetadata, x: T) = Unit
|
||||
operator inline fun <reified T> C.getValue(t: Any?, p: KProperty<*>): T = null!!
|
||||
operator inline fun <reified T> C.setValue(t: Any?, p: KProperty<*>, x: T) = Unit
|
||||
|
||||
+6
-6
@@ -5,17 +5,17 @@ public var a1: [ERROR : Type from delegate]
|
||||
public var b: kotlin.Int
|
||||
public var c: kotlin.String
|
||||
public val cObj: C
|
||||
public operator fun </*0*/ T> B.getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T
|
||||
@kotlin.inline() public operator fun </*0*/ reified T> C.getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T
|
||||
public operator fun </*0*/ T> B.setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit
|
||||
@kotlin.inline() public operator fun </*0*/ reified T> C.setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit
|
||||
public operator fun </*0*/ T> B.getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): T
|
||||
@kotlin.inline() public operator fun </*0*/ reified T> C.getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): T
|
||||
public operator fun </*0*/ T> B.setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ x: T): kotlin.Unit
|
||||
@kotlin.inline() public operator fun </*0*/ reified T> C.setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ x: T): kotlin.Unit
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun </*0*/ T> getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T
|
||||
public final operator fun </*0*/ T> getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun </*0*/ T> setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit
|
||||
public final operator fun </*0*/ T> setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ x: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
-2
@@ -1,9 +1,11 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A3 {
|
||||
val a: String by l@ MyProperty()
|
||||
|
||||
class MyProperty<T> {}
|
||||
|
||||
operator fun <T> MyProperty<T>.getValue(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
operator fun <T> MyProperty<T>.getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
throw Exception("$thisRef $desc")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@ public final class A3 {
|
||||
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 </*0*/ T> A3.MyProperty<T>.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun </*0*/ T> A3.MyProperty<T>.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
|
||||
public final class MyProperty</*0*/ T> {
|
||||
public constructor MyProperty</*0*/ T>()
|
||||
|
||||
Vendored
+5
-3
@@ -1,5 +1,7 @@
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A {
|
||||
var a5: String by <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>MyProperty1<!>()
|
||||
var b5: String by <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getMyProperty1<!>()
|
||||
@@ -9,7 +11,7 @@ fun <A, B> getMyProperty1() = MyProperty1<A, B>()
|
||||
|
||||
class MyProperty1<T, R> {
|
||||
|
||||
operator fun getValue(thisRef: R, desc: PropertyMetadata): T {
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): T {
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
@@ -29,7 +31,7 @@ fun <A, B> getMyProperty2() = MyProperty2<A, B>()
|
||||
|
||||
class MyProperty2<T, R> {
|
||||
|
||||
operator fun getValue(thisRef: R, desc: PropertyMetadata): T {
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): T {
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
@@ -39,4 +41,4 @@ class MyProperty2<T, R> {
|
||||
}
|
||||
|
||||
// -----------------
|
||||
fun println(a: Any?) = a
|
||||
fun println(a: Any?) = a
|
||||
|
||||
Vendored
+2
-2
@@ -26,7 +26,7 @@ package foo {
|
||||
public final class MyProperty1</*0*/ T, /*1*/ R> {
|
||||
public constructor MyProperty1</*0*/ T, /*1*/ R>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun setValue(/*0*/ i: kotlin.Int, /*1*/ j: kotlin.Any, /*2*/ k: kotlin.Int): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
@@ -35,7 +35,7 @@ package foo {
|
||||
public final class MyProperty2</*0*/ T, /*1*/ R> {
|
||||
public constructor MyProperty2</*0*/ T, /*1*/ R>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun setValue(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
+4
-2
@@ -1,14 +1,16 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A {
|
||||
var a by <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>MyProperty<!>()
|
||||
}
|
||||
|
||||
class MyProperty<T, R> {
|
||||
|
||||
operator fun getValue(thisRef: R, desc: PropertyMetadata): T {
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): T {
|
||||
throw Exception("$thisRef $desc")
|
||||
}
|
||||
|
||||
operator fun setValue(thisRef: R, desc: PropertyMetadata, t: T) {
|
||||
operator fun setValue(thisRef: R, desc: KProperty<*>, t: T) {
|
||||
throw Exception("$thisRef $desc $t")
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ public final class A {
|
||||
public final class MyProperty</*0*/ T, /*1*/ R> {
|
||||
public constructor MyProperty</*0*/ T, /*1*/ R>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ t: T): kotlin.Unit
|
||||
public final operator fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>, /*2*/ t: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Vendored
+4
-2
@@ -1,5 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A {
|
||||
val a by MyProperty()
|
||||
|
||||
@@ -9,5 +11,5 @@ class A {
|
||||
}
|
||||
|
||||
class MyProperty<R> {
|
||||
operator fun getValue(thisRef: R, desc: PropertyMetadata): Int = throw Exception("$thisRef $desc")
|
||||
}
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): Int = throw Exception("$thisRef $desc")
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -12,7 +12,7 @@ public final class A {
|
||||
public final class MyProperty</*0*/ R> {
|
||||
public constructor MyProperty</*0*/ R>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): kotlin.Int
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
+9
-7
@@ -1,5 +1,7 @@
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A1 {
|
||||
var a1: String by MyProperty1()
|
||||
var b1: String by getMyProperty1()
|
||||
@@ -12,12 +14,12 @@ fun <A, B> getMyProperty1() = MyProperty1<A, B>()
|
||||
|
||||
class MyProperty1<R, T> {
|
||||
|
||||
operator fun getValue(thisRef: R, desc: PropertyMetadata): T {
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): T {
|
||||
println("get $thisRef ${desc.name}")
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
operator fun setValue(thisRef: R, desc: PropertyMetadata, value: T) {
|
||||
operator fun setValue(thisRef: R, desc: KProperty<*>, value: T) {
|
||||
println("set $thisRef ${desc.name} $value")
|
||||
}
|
||||
}
|
||||
@@ -36,12 +38,12 @@ fun <A> getMyProperty2() = MyProperty2<A>()
|
||||
|
||||
class MyProperty2<T> {
|
||||
|
||||
operator fun getValue(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
operator fun getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
println("get $thisRef ${desc.name}")
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
operator fun setValue(thisRef: Any?, desc: PropertyMetadata, value: T) {
|
||||
operator fun setValue(thisRef: Any?, desc: KProperty<*>, value: T) {
|
||||
println("set $thisRef ${desc.name} $value")
|
||||
}
|
||||
}
|
||||
@@ -60,15 +62,15 @@ fun <A> getMyProperty3() = MyProperty3<A>()
|
||||
|
||||
class MyProperty3<T> {
|
||||
|
||||
operator fun getValue(thisRef: T, desc: PropertyMetadata): String {
|
||||
operator fun getValue(thisRef: T, desc: KProperty<*>): String {
|
||||
println("get $thisRef ${desc.name}")
|
||||
return ""
|
||||
}
|
||||
|
||||
operator fun setValue(thisRef: Any?, desc: PropertyMetadata, value: T) {
|
||||
operator fun setValue(thisRef: Any?, desc: KProperty<*>, value: T) {
|
||||
println("set $thisRef ${desc.name} $value")
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
fun println(a: Any?) = a
|
||||
fun println(a: Any?) = a
|
||||
|
||||
+6
-6
@@ -42,27 +42,27 @@ package foo {
|
||||
public final class MyProperty1</*0*/ R, /*1*/ T> {
|
||||
public constructor MyProperty1</*0*/ R, /*1*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit
|
||||
public final operator fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>, /*2*/ value: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class MyProperty2</*0*/ T> {
|
||||
public constructor MyProperty2</*0*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit
|
||||
public final operator fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.reflect.KProperty<*>, /*2*/ value: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class MyProperty3</*0*/ T> {
|
||||
public constructor MyProperty3</*0*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: T, /*1*/ desc: kotlin.PropertyMetadata): kotlin.String
|
||||
public final operator fun getValue(/*0*/ thisRef: T, /*1*/ desc: kotlin.reflect.KProperty<*>): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit
|
||||
public final operator fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.reflect.KProperty<*>, /*2*/ value: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -1,5 +1,7 @@
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A1 {
|
||||
val a1: String by MyProperty1()
|
||||
val b1: String by getMyProperty1()
|
||||
@@ -12,7 +14,7 @@ fun <A, B> getMyProperty1() = MyProperty1<A, B>()
|
||||
|
||||
class MyProperty1<R, T> {
|
||||
|
||||
operator fun getValue(thisRef: R, desc: PropertyMetadata): T {
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): T {
|
||||
println("get $thisRef ${desc.name}")
|
||||
throw Exception()
|
||||
}
|
||||
@@ -32,7 +34,7 @@ fun <A> getMyProperty2() = MyProperty2<A>()
|
||||
|
||||
class MyProperty2<T> {
|
||||
|
||||
operator fun getValue(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
operator fun getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
println("get $thisRef ${desc.name}")
|
||||
throw Exception()
|
||||
}
|
||||
@@ -52,11 +54,11 @@ fun <A> getMyProperty3() = MyProperty3<A>()
|
||||
|
||||
class MyProperty3<T> {
|
||||
|
||||
operator fun getValue(thisRef: T, desc: PropertyMetadata): String {
|
||||
operator fun getValue(thisRef: T, desc: KProperty<*>): String {
|
||||
println("get $thisRef ${desc.name}")
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
fun println(a: Any?) = a
|
||||
fun println(a: Any?) = a
|
||||
|
||||
+3
-3
@@ -42,7 +42,7 @@ package foo {
|
||||
public final class MyProperty1</*0*/ R, /*1*/ T> {
|
||||
public constructor MyProperty1</*0*/ R, /*1*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -50,7 +50,7 @@ package foo {
|
||||
public final class MyProperty2</*0*/ T> {
|
||||
public constructor MyProperty2</*0*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T
|
||||
public final operator fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -58,7 +58,7 @@ package foo {
|
||||
public final class MyProperty3</*0*/ T> {
|
||||
public constructor MyProperty3</*0*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final operator fun getValue(/*0*/ thisRef: T, /*1*/ desc: kotlin.PropertyMetadata): kotlin.String
|
||||
public final operator fun getValue(/*0*/ thisRef: T, /*1*/ desc: kotlin.reflect.KProperty<*>): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user