Files
kotlin-fork/compiler/visualizer/testData/rawBuilder/declarations/delegates.kt
T
Ivan Kylchik ce844a9bba [VISUALIZER] Disable rendering of value arguments in psi part
For now instead of arguments will be rendered parameters
2021-03-19 18:30:03 +03:00

32 lines
1.3 KiB
Kotlin
Vendored

import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
// fun <T> lazy<Int>(() -> T): Lazy<T>
// │ Int
// │ │ fun (Int).plus(Int): Int
// Int │ │ │ Int
// │ │ │ │ │
val x: Int by lazy { 1 + 2 }
// properties/ReadWriteProperty<Any?, Int>
// │ properties/ReadWriteProperty<Any?, Int>
// │ │
val delegate = object: ReadWriteProperty<Any?, Int> {
// reflect/KProperty<*>
// │ Int
// │ │ Int
// │ │ │
override fun getValue(thisRef: Any?, property: KProperty<*>): Int = 1
// reflect/KProperty<*>
// │
override fun setValue(thisRef: Any?, property: KProperty<*>, value: Int) {}
}
// Int val delegate: properties/ReadWriteProperty<Any?, Int>
// │ │
val value by delegate
// Int val delegate: properties/ReadWriteProperty<Any?, Int>
// │ │
var variable by delegate