[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)
}
@@ -0,0 +1,37 @@
public final class UInt /* UInt*/ {
private final int value;
}
public enum Foo /* Foo*/ {
;
private final int x;
@org.jetbrains.annotations.NotNull()
public static Foo valueOf(@org.jetbrains.annotations.NotNull() java.lang.String) throws java.lang.IllegalArgumentException;// valueOf(java.lang.String)
@org.jetbrains.annotations.NotNull()
public static Foo[] values();// values()
public final int getX();// getX()
}
public final class InlinedDelegate /* InlinedDelegate*/<T> {
private T node;
public final T getNode();// getNode()
}
public final class InlineInheritance /* InlineInheritance*/ {
private final int v;
public final int getV();// getV()
public int getX();// getX()
public int y();// y()
}