Minor: add regression test for KT-41806

This commit is contained in:
Pavel Kirpichenkov
2020-09-14 18:17:11 +03:00
parent 2fad935ce2
commit b102042dd8
5 changed files with 46 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// IGNORE_BACKEND_FIR: JVM_IR
open class A {
fun Foo() {
print("Fop")
}
}
class B() : A()
class C() : A()
fun box(): String {
var test : A = B()
println((test as B).toString())
listOf(1,2 ,3).forEach { it ->
test = C()
}
test.Foo()
return "OK"
}