Files
kotlin/compiler/testData/writeFlags/function/classObjectPrivate/privateVar.kt
Mikaël Peltier d0ed0c4049 KT-14258 Optimize accesses to properties defined into companion
- 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
2018-03-14 15:30:40 +01:00

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