Fix for-in iterator over array of boxed inline class values

#KT-25324 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2018-07-11 02:23:41 +03:00
parent 584c888e5b
commit 0308e10c11
9 changed files with 111 additions and 3 deletions
@@ -0,0 +1,16 @@
// !LANGUAGE: +InlineClasses
// WITH_RUNTIME
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
inline class Foo(val arg: Int)
fun box(): String {
val arr = arrayOf(Foo(1), Foo(2))
var sum = 0
for (el in arr) {
sum += el.arg
}
return if (sum != 3) "Fail" else "OK"
}