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

#KT-25325 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2018-07-11 02:47:05 +03:00
parent 0308e10c11
commit 4e3674b330
9 changed files with 92 additions and 6 deletions
@@ -0,0 +1,16 @@
// !LANGUAGE: +InlineClasses
// WITH_RUNTIME
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
inline class Foo(val arg: String)
fun box(): String {
val ls = listOf(Foo("abc"), Foo("def"))
var res = ""
for (el in ls) {
res += el.arg
}
return if (res != "abcdef") "Fail" else "OK"
}