c922484758
The current backend uses direct field access to the backing field
instead of calling the companion object accessor, which calls
an accessibility bridge, which then gets the field for code such as:
```
class A {
companion object {
val s: String = "OK"
}
// f uses direct access to the A.s backing field.
fun f() = s
}
```
This change does the same for the IR backend.
19 lines
265 B
Kotlin
Vendored
19 lines
265 B
Kotlin
Vendored
class A {
|
|
companion object {
|
|
val s = "OK"
|
|
var v = "NOT OK"
|
|
}
|
|
|
|
inline fun f(): String = s
|
|
|
|
inline fun g() {
|
|
v = "OK"
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val a = A()
|
|
if (a.f() != "OK") return "FAIL0"
|
|
a.g()
|
|
return A.v
|
|
} |