d0ed0c4049
- Use direct access to property defined into companion object when it is possible rather than always use an accessor to access the property. - Use direct access will speedup runtime performance. - Avoid to generate useless accessors for companion properties. Fix of https://youtrack.jetbrains.com/issue/KT-14258
16 lines
435 B
Kotlin
Vendored
16 lines
435 B
Kotlin
Vendored
// Checks that methods 'access$getMy$p', 'access$getMy$cp' and 'getMy' are not generated and
|
|
// that backed field 'my' is directly used through a 'getstatic'
|
|
|
|
class My {
|
|
companion object {
|
|
private val my: String = "OK"
|
|
}
|
|
|
|
fun getMyValue() = my
|
|
}
|
|
|
|
// 1 GETSTATIC My.my
|
|
// 1 PUTSTATIC My.my
|
|
// 0 INVOKESTATIC My\$Companion.access\$getMy\$p
|
|
// 0 INVOKESTATIC My.access\$getMy\$cp
|
|
// 0 INVOKESPECIAL My\$Companion.getMy |