[AA LC] Generate backing field for inline classes

This commit is contained in:
Dmitriy Novozhilov
2022-08-10 13:43:55 +03:00
parent 8e80c5830e
commit b7712a35f0
3 changed files with 45 additions and 2 deletions
@@ -209,7 +209,7 @@ internal open class SymbolLightClass(
result
}
private fun addPropertyBackingFields(result: MutableList<KtLightField>) {
protected fun addPropertyBackingFields(result: MutableList<KtLightField>) {
val propertySymbols = classOrObjectSymbol.getDeclaredMemberScope().getCallableSymbols()
.filterIsInstance<KtPropertySymbol>()
.applyIf(isCompanionObject) {
@@ -57,9 +57,15 @@ internal class SymbolLightInlineClass(
result
}
private val _ownFields: List<KtLightField> by lazyPub {
mutableListOf<KtLightField>().apply {
addPropertyBackingFields(this)
}
}
override fun getOwnMethods(): List<PsiMethod> = _ownMethods
override fun getOwnFields(): List<KtLightField> = emptyList()
override fun getOwnFields(): List<KtLightField> = _ownFields
override fun copy(): SymbolLightInlineClass = SymbolLightInlineClass(classOrObjectSymbol, manager)
}