Files
Vlad Koshkin 83c3a6593e [kotlin] SelfAssignmentInspection to k2
^KTIJ-28428 Fixed

GitOrigin-RevId: 3e463839201bda417d235bb15efc56b58d6e3959
2024-01-11 15:50:39 +00:00

21 lines
444 B
Kotlin

// PROBLEM: none
// WITH_STDLIB
// IGNORE_K2
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
class Test {
var foo: Int by Delegate()
fun test() {
foo = <caret>foo
}
}
class Delegate : ReadWriteProperty<Test, Int> {
override fun getValue(thisRef: Test, property: KProperty<*>): Int = 1
override fun setValue(thisRef: Test, property: KProperty<*>, value: Int) {
println()
}
}