[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