JVM_IR. Accessor lowering
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class A {
|
||||
fun foo() = o_plus_f_plus_k {""}
|
||||
|
||||
companion object {
|
||||
private val o = "O"
|
||||
private val k = "K"
|
||||
|
||||
private inline fun o_plus_f1_plus_f2(f1: () -> String, f2: () -> String) = o + f1() + f2()
|
||||
private inline fun o_plus_f_plus_k(f: () -> String) = o_plus_f1_plus_f2(f) { k }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A().foo()
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
// FILE: A.kt
|
||||
package a
|
||||
import b.*
|
||||
|
||||
class A {
|
||||
fun foo() = ok
|
||||
|
||||
companion object : B()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A().foo()
|
||||
}
|
||||
|
||||
// FILE: B.kt
|
||||
package b
|
||||
|
||||
open class B {
|
||||
@JvmField protected val ok = "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user