573188bdc4
Currently FirThisReceiverExpression of instance methods are translated to references of the class' thisReceiver, not the method's dispatch receiver, which causes problems with IrFrameMap::typeOf, as the class' thisReceiver is not in the typeMap. This commit translates non-qualified "this" references of instance methods to references of the methods' dispatch receiver.
31 lines
500 B
Kotlin
Vendored
31 lines
500 B
Kotlin
Vendored
// !JVM_DEFAULT_MODE: enable
|
|
// TARGET_BACKEND: JVM
|
|
// JVM_TARGET: 1.8
|
|
// WITH_RUNTIME
|
|
|
|
interface Test {
|
|
@JvmDefault
|
|
fun test(): String {
|
|
return inlineProp
|
|
}
|
|
|
|
fun testDefaultImpls(): String {
|
|
return inlineProp
|
|
}
|
|
|
|
@JvmDefault
|
|
private inline val inlineProp: String
|
|
get() = "OK"
|
|
|
|
}
|
|
|
|
class TestClass : Test {
|
|
|
|
}
|
|
|
|
fun box(): String {
|
|
val foo = TestClass()
|
|
if (foo.test() != "OK") return "fail: ${foo.test()}"
|
|
return foo.testDefaultImpls()
|
|
}
|