Files
kotlin-fork/idea/testData/inspectionsLocal/selfAssignment/propertyHasDelegate.kt
T
2017-11-02 11:07:52 +03:00

20 lines
432 B
Kotlin
Vendored

// PROBLEM: none
// WITH_RUNTIME
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()
}
}