JVM_IR KT-47326 downcast field receiver on JvmField lowering

This commit is contained in:
Dmitry Petrov
2021-06-18 17:55:51 +03:00
committed by TeamCityServer
parent ebc4e10684
commit c19792e7c5
24 changed files with 530 additions and 8 deletions
+22
View File
@@ -0,0 +1,22 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
interface A { var x: Int }
class B(@JvmField override var x: Int): A
class C<D: A>(@JvmField val d: D)
class E(c: C<B>) {
init {
c.d.x = 42
}
val ax = c.d.x
}
fun box(): String {
val e = E(C(B(1234)))
if (e.ax != 42)
return "Failed: ${e.ax}"
return "OK"
}