blob: 7d7d78acbb5c9eb8087c972e5333a4160a068716 [file]
// WITH_STDLIB
// ISSUE: KT-65165
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
private class TransformedConfigPropertyString(
defaultValue: String,
private val transform: (String) -> Regex
) : ReadOnlyProperty<SampleClass, Regex> {
override fun getValue(thisRef: SampleClass, property: KProperty<*>): Regex {
return transform("string")
}
}
class SampleClass {
val ignoreStringsRegex: Regex by TransformedConfigPropertyString("$^", String::toRegex)
}
fun box(): String {
SampleClass().ignoreStringsRegex
return "OK"
}