[FIR] Introduce valueClassRepresentation to FIR

#KT-1179
This commit is contained in:
Evgeniy.Zhelenskiy
2022-03-14 16:33:05 +03:00
committed by teamcity
parent 28bf83ceac
commit b6f2513dd2
16 changed files with 131 additions and 33 deletions
@@ -172,18 +172,18 @@ class FirElementSerializer private constructor(
builder.companionObjectName = getSimpleNameIndex(companionObject.name)
}
val representation = (klass as? FirRegularClass)?.getInlineClassUnderlyingParameter(session)
val representation = (klass as? FirRegularClass)?.inlineClassRepresentation
if (representation != null) {
builder.inlineClassUnderlyingPropertyName = getSimpleNameIndex(representation.name)
builder.inlineClassUnderlyingPropertyName = getSimpleNameIndex(representation.underlyingPropertyName)
val property = callableMembers.single {
it is FirProperty && it.receiverTypeRef == null && it.name == representation.name
it is FirProperty && it.receiverTypeRef == null && it.name == representation.underlyingPropertyName
}
if (!property.visibility.isPublicAPI) {
if (useTypeTable()) {
builder.inlineClassUnderlyingTypeId = typeId(representation.returnTypeRef)
builder.inlineClassUnderlyingTypeId = typeId(representation.underlyingType)
} else {
builder.setInlineClassUnderlyingType(typeProto(representation.returnTypeRef))
builder.setInlineClassUnderlyingType(typeProto(representation.underlyingType))
}
}
}