JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter

This commit is contained in:
Dmitry Petrov
2021-12-09 15:34:42 +03:00
committed by Space
parent 94bb465e62
commit 627d838343
12 changed files with 191 additions and 10 deletions
@@ -0,0 +1,24 @@
interface Z {
fun testFun() : String {
return privateFun()
}
fun testProperty() : String {
return privateProp
}
private fun privateFun(): String {
return "O"
}
private val privateProp: String
get() = "K"
}
object Z2 : Z
fun box() : String {
return Z2.testFun() + Z2.testProperty()
}
// 0 CHECKCAST
@@ -0,0 +1,12 @@
open class A {
fun foo(i: Int = 42) {}
}
class B : A()
fun test() {
B().foo()
}
// JVM_IR_TEMPLATES
// 0 CHECKCAST
@@ -0,0 +1,9 @@
interface Tr {
fun extra(): String = "e"
}
class N : Tr {
override fun extra(): String = super.extra()
}
// 0 CHECKCAST