Files
kotlin-fork/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt
T

19 lines
310 B
Kotlin
Vendored

// FIR_IDENTICAL
// !CHECK_TYPE
fun test(bal: Array<Int>) {
var bar = 4
val a = { bar += 4 }
checkSubtype<() -> Unit>(a)
val b = { bar = 4 }
checkSubtype<() -> Unit>(b)
val c = { bal[2] = 3 }
checkSubtype<() -> Unit>(c)
val d = run { bar += 4 }
checkSubtype<Unit>(d)
}