JVM_IR add test for KT-49411

This commit is contained in:
Dmitry Petrov
2021-10-26 12:53:31 +03:00
committed by TeamCityServer
parent 56cf2549e7
commit e76cf8550e
5 changed files with 45 additions and 0 deletions
@@ -0,0 +1,22 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
abstract class Foo<T>(@JvmField val foo: T)
class Bar(foo: Int) : Foo<Int>(foo)
fun box(): String {
var s1 = ""
for (i in Bar(3).foo.downTo(1)) {
s1 = s1 + i
}
if (s1 != "321") return "Failed: s1='$s1'"
var s2 = ""
for (i in 3.downTo(Bar(1).foo)) {
s2 = s2 + i
}
if (s2 != "321") return "Failed: s2='$s2'"
return "OK"
}