JVM_IR KT-48295 don't upcast field receiver with super qualifier

This commit is contained in:
Dmitry Petrov
2021-08-19 12:57:42 +03:00
committed by TeamCityServer
parent 7038b02933
commit a3bb9dde45
7 changed files with 93 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: a.kt
package a
open class A {
@JvmField protected var result = "Fail"
}
// FILE: b.kt
class B : a.A() {
fun test(): String {
super.result = "OK"
return super.result
}
}
fun box(): String = B().test()
+23
View File
@@ -0,0 +1,23 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: a.kt
package a
open class A {
@JvmField protected var result = "Fail"
}
open class AA : A()
// FILE: b.kt
class B : a.AA() {
fun test(): String {
super.result = "OK"
return super.result
}
}
fun box(): String = B().test()