[Tests] Add test for KT-44199
^KT-44199 Fixed
This commit is contained in:
committed by
Space Team
parent
1ad0872958
commit
a9af52c288
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user