mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 15:53:40 +00:00
18 lines
293 B
Kotlin
Vendored
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)
|
|
}
|