Files
kotlin/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt
Stanislav Erokhin 298a075381 Minor. removed functions which declared in Standard.kt from diagnostic testdata.
Removed declaration for functions: TODO, run, with, apply, let.
2016-01-25 19:13:31 +03:00

18 lines
293 B
Kotlin
Vendored

// !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)
}