JVM_IR KT-46597 fix receiver type for inlined callable reference
Receiver type is used by SyntheticAccessorLowering to determine class in which a synthetic accessor should be generated.
This commit is contained in:
committed by
TeamCityServer
parent
80ce3a5cf8
commit
3a0e3798ec
+21
@@ -0,0 +1,21 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
// FILE: a/Base.java
|
||||
package a;
|
||||
|
||||
public class Base {
|
||||
protected String property = "OK";
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
import a.Base
|
||||
|
||||
class SubClass : Base() {
|
||||
fun call() =
|
||||
higherOrder(::property)
|
||||
|
||||
inline fun higherOrder(crossinline lambda: () -> String) =
|
||||
lambda()
|
||||
}
|
||||
|
||||
fun box() = SubClass().call()
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
abstract class Base {
|
||||
@JvmField
|
||||
protected val property = "OK"
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
import a.Base
|
||||
|
||||
class SubClass : Base() {
|
||||
fun call() =
|
||||
higherOrder(::property)
|
||||
|
||||
inline fun higherOrder(crossinline lambda: () -> String) =
|
||||
lambda()
|
||||
}
|
||||
|
||||
fun box() = SubClass().call()
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
abstract class Base {
|
||||
protected fun method() = "OK"
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
import a.Base
|
||||
|
||||
class SubClass : Base() {
|
||||
fun call() =
|
||||
higherOrder(::method)
|
||||
|
||||
inline fun higherOrder(crossinline lambda: () -> String) =
|
||||
lambda()
|
||||
}
|
||||
|
||||
fun box() = SubClass().call()
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
abstract class Base {
|
||||
protected val property get() = "OK"
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
import a.Base
|
||||
|
||||
class SubClass : Base() {
|
||||
fun call() =
|
||||
higherOrder(::property)
|
||||
|
||||
inline fun higherOrder(crossinline lambda: () -> String) =
|
||||
lambda()
|
||||
}
|
||||
|
||||
fun box() = SubClass().call()
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// FILE: a/Base.java
|
||||
package a;
|
||||
|
||||
public class Base {
|
||||
protected String property = "OK";
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
import a.Base
|
||||
|
||||
class SubClass : Base() {
|
||||
fun call() = ::property
|
||||
}
|
||||
|
||||
fun box() = SubClass().call().invoke()
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
abstract class Base {
|
||||
@JvmField
|
||||
protected val property = "OK"
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
import a.Base
|
||||
|
||||
class SubClass : Base() {
|
||||
fun call() = ::property
|
||||
}
|
||||
|
||||
fun box() = SubClass().call().invoke()
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
abstract class Base {
|
||||
protected fun method() = "OK"
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
import a.Base
|
||||
|
||||
class SubClass : Base() {
|
||||
fun call() = ::method
|
||||
}
|
||||
|
||||
fun box() = SubClass().call().invoke()
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
abstract class Base {
|
||||
protected val property get() = "OK"
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
import a.Base
|
||||
|
||||
class SubClass : Base() {
|
||||
fun call() = ::property
|
||||
}
|
||||
|
||||
fun box() = SubClass().call().invoke()
|
||||
Reference in New Issue
Block a user