Files
kotlin-fork/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.kt.txt
T
Dmitriy Novozhilov 65ea4e184a [FIR] Fix enhancement of FlexibleNullability and EnhancedNullability
- Add utilities to add new attribute to ConeAttributes
- Get rid of FlexibleNullability attribute (it can be easily inferred
    for any flexible type at any moment)
- Fix determining of EnhancedNullability attribute
2021-03-11 13:10:04 +03:00

31 lines
904 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: @FlexibleNullability Int?
val x$delegate: HashMap<String, Int> = hashMapOf<String, Int>()
local get(): @FlexibleNullability Int? {
return x$delegate.getValue<@FlexibleNullability Int?, @FlexibleNullability Int?>(thisRef = null, property = ::x)
}
local set(<set-?>: @FlexibleNullability Int?) {
x$delegate.setValue<@FlexibleNullability Int?>(thisRef = null, property = ::x, value = <set-?>)
}
<set-x>(<set-?> = 0)
val <unary>: @FlexibleNullability Int? = <get-x>()
<set-x>(<set-?> = <unary>.inc())
<unary> /*~> Unit */
<set-x>(<set-?> = <get-x>().plus(other = 1))
}