Files
kotlin-fork/compiler/testData/diagnostics/tests/unusedVariableOnRegularDelegatedProperty.fir.kt
T
2023-03-27 13:46:13 +00:00

22 lines
478 B
Kotlin
Vendored

// !DIAGNOSTICS: +UNUSED_VARIABLE
import kotlin.reflect.KProperty
class Example {
val valProp: String by Delegate()
val varProp: String by Delegate()
fun foo() {
val valVariable by Delegate()
val varVariable by Delegate()
}
}
class Delegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>): String = "delegation"
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {
// setValue
}
}