[FIR] Forbid suspend operator get/setValue and provideDelegate

#KT-58989 Fixed
This commit is contained in:
Kirill Rakhman
2023-05-30 15:40:09 +02:00
committed by Space Team
parent aea8bac7d2
commit ca022cf4dc
3 changed files with 15 additions and 7 deletions
@@ -4,5 +4,5 @@ fun bar(d: Delegate): String {
}
class Delegate {
suspend operator fun getValue(thisRef: Any?, property: Any?): String = ""
suspend <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun getValue(thisRef: Any?, property: Any?): String = ""
}
@@ -35,9 +35,9 @@ class A {
suspend <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun equals(a: A) = a === this
suspend operator fun set(a: A, b: A) {}
suspend operator fun provideDelegate(a: A, p: KProperty<*>) = a
suspend operator fun getValue(a: A, p: KProperty<*>) = a
suspend operator fun setValue(a: A, p: KProperty<*>, b: A) {}
suspend <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun provideDelegate(a: A, p: KProperty<*>) = a
suspend <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun getValue(a: A, p: KProperty<*>) = a
suspend <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun setValue(a: A, p: KProperty<*>, b: A) {}
}
class B