Files
kotlin-fork/compiler/visualizer/testData/rawBuilder/declarations/delegates.kt
T
2021-03-19 18:29:58 +03:00

37 lines
1.4 KiB
Kotlin
Vendored

// FIR_IGNORE
// package kotlin
// │
import kotlin.properties.ReadWriteProperty
// package kotlin
// │
import kotlin.reflect.KProperty
// fun <T> lazy<Int>(() -> Int): Lazy<Int>
// │ 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