JVM_IR. Accessor lowering

This commit is contained in:
Georgy Bronnikov
2018-09-17 14:35:25 +03:00
parent a23aae590e
commit 376eef05f5
16 changed files with 691 additions and 310 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// Enable for JVM backend when KT-8120 gets fixed
// IGNORE_BACKEND: JVM
@@ -26,4 +25,4 @@ fun box(): String {
if (log != "111") return "fail: ${log}"
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// Enable for JVM backend when KT-8120 gets fixed
// IGNORE_BACKEND: JVM
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
class A {
val a = 1
fun calc () : Int {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun box(): String {
var log = ""
@@ -22,4 +21,4 @@ fun box(): String {
if (log != "(1;1)(1;1)(1;1)") return "fail: ${log}"
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_RUNTIME
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField
// IGNORE_BACKEND: JVM_IR
class Outer {
private companion object {
@@ -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"
}