[Tests] Add test for KT-44199

^KT-44199 Fixed
This commit is contained in:
Vladimir Sukharev
2024-03-06 11:05:12 +01:00
committed by Space Team
parent 1ad0872958
commit a9af52c288
22 changed files with 143 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import kotlin.reflect.KProperty
class WrapperDelegate<T>(val value: T) {
inline operator fun getValue(thisRef: Any?, property: KProperty<*>) = value
}
class NameWrapperDelegate<T>(val build: (String) -> T) {
inline operator fun provideDelegate(thisRef: Any?, property: KProperty<*>) = WrapperDelegate(build(property.name))
}
object Annotations {
val O by NameWrapperDelegate { it + "K" }
val Second by NameWrapperDelegate { it + "-prop2" }
}
fun box(): String {
return Annotations.O.toString()
}