[FIR] Don't report DEPRECATION on self-access in delegated property

#KT-60682
This commit is contained in:
Kirill Rakhman
2023-08-25 13:28:13 +02:00
committed by Space Team
parent 411210b520
commit 21f8ba1706
4 changed files with 70 additions and 1 deletions
@@ -13,6 +13,15 @@ class Delegate() {
operator fun setValue(instance: Any, property: KProperty<*>, value: Int) {}
}
class Delegate2() {
operator fun getValue(instance: Any, property: KProperty<*>) : Int = 1
operator fun setValue(instance: Any, property: KProperty<*>, value: Int) {}
}
class DelegateProvider() {
operator fun provideDelegate(instance: Any, property: KProperty<*>) = Delegate2()
}
class PropertyHolder {
@Deprecated("text")
val x = 1
@@ -23,6 +32,14 @@ class PropertyHolder {
val valDelegate by <!DEPRECATION!>Delegate<!>()
var varDelegate by <!DEPRECATION, DEPRECATION!>Delegate<!>()
// no deprecation caused by access to itself
@Deprecated("text")
var deprecatedDelegated by Delegate2()
// no deprecation caused by access to itself
@Deprecated("text")
val deprecatedDelegated2 by DelegateProvider()
public val test1: String = ""
@Deprecated("val-getter") get
@@ -13,6 +13,15 @@ class Delegate() {
operator fun setValue(instance: Any, property: KProperty<*>, value: Int) {}
}
class Delegate2() {
operator fun getValue(instance: Any, property: KProperty<*>) : Int = 1
operator fun setValue(instance: Any, property: KProperty<*>, value: Int) {}
}
class DelegateProvider() {
operator fun provideDelegate(instance: Any, property: KProperty<*>) = Delegate2()
}
class PropertyHolder {
@Deprecated("text")
val x = 1
@@ -23,6 +32,14 @@ class PropertyHolder {
val valDelegate by <!DEPRECATION!>Delegate()<!>
var varDelegate by <!DEPRECATION, DEPRECATION!>Delegate()<!>
// no deprecation caused by access to itself
@Deprecated("text")
var deprecatedDelegated by Delegate2()
// no deprecation caused by access to itself
@Deprecated("text")
val deprecatedDelegated2 by DelegateProvider()
public val test1: String = ""
@Deprecated("val-getter") get
@@ -13,8 +13,27 @@ public final class Delegate {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class Delegate2 {
public constructor Delegate2()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final operator fun getValue(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.reflect.KProperty<*>): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun setValue(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.reflect.KProperty<*>, /*2*/ value: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class DelegateProvider {
public constructor DelegateProvider()
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 provideDelegate(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.reflect.KProperty<*>): Delegate2
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class PropertyHolder {
public constructor PropertyHolder()
@kotlin.Deprecated(message = "text") public final var deprecatedDelegated: kotlin.Int
@kotlin.Deprecated(message = "text") public final val deprecatedDelegated2: kotlin.Int
@kotlin.Deprecated(message = "text") public final var name: kotlin.String
@get:kotlin.Deprecated(message = "val-getter") public final val test1: kotlin.String = ""
@get:kotlin.Deprecated(message = "var-getter") @set:kotlin.Deprecated(message = "var-setter") public final var test2: kotlin.String