Files
kotlin-fork/compiler/testData/ir/irText/declarations/localDelegatedProperties.kt.txt
T
Dmitriy Novozhilov b454fcc1e0 [FIR] Save IR dumps to .ir.txt files instead of .txt in tests
This is needed to avoid clashes between different dumps from different
  handlers
2021-10-12 17:26:36 +03:00

32 lines
760 B
Plaintext
Vendored

fun test1() {
val x: Int
val x$delegate: Lazy<Int> = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42
}
)
local get(): Int {
return x$delegate.getValue<Int>(thisRef = null, property = ::x)
}
println(message = <get-x>())
}
fun test2() {
var x: Int
val x$delegate: HashMap<String, Int> = hashMapOf<String, Int>()
local get(): Int {
return x$delegate.getValue<Int, Int>(thisRef = null, property = ::x)
}
local set(value: Int) {
return x$delegate.setValue<Int>(thisRef = null, property = ::x, value = value)
}
<set-x>(value = 0)
{ // BLOCK
val tmp0: Int = <get-x>()
<set-x>(value = tmp0.inc())
tmp0
} /*~> Unit */
<set-x>(value = <get-x>().plus(other = 1))
}