mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-14 08:31:35 +00:00
16 lines
392 B
Kotlin
Vendored
16 lines
392 B
Kotlin
Vendored
// !LANGUAGE: -ProperForInArrayLoopRangeVariableAssignmentSemantic
|
|
// !DIAGNOSTICS: -UNUSED_VALUE
|
|
// SKIP_TXT
|
|
|
|
var xs: IntArray = intArrayOf(1, 2, 3)
|
|
get() = field
|
|
set(ys) {
|
|
var sum = 0
|
|
for (x in field) {
|
|
sum = sum * 10 + x
|
|
field = intArrayOf(4, 5, 6)
|
|
}
|
|
if (sum != 123) throw AssertionError("sum=$sum")
|
|
field = ys
|
|
}
|