mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
- 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
14 lines
297 B
Kotlin
Vendored
14 lines
297 B
Kotlin
Vendored
class Foo {
|
|
|
|
init {Foo.test}
|
|
|
|
companion object {
|
|
private var test = "String"
|
|
// Custom setter is needed, otherwise no need to generate setTest
|
|
set(v) { field = v }
|
|
}
|
|
}
|
|
|
|
// TESTED_OBJECT_KIND: function
|
|
// TESTED_OBJECTS: Foo$Companion, setTest
|
|
// FLAGS: ACC_PRIVATE, ACC_FINAL |