Added 'isInline' implementation to property accessor descriptors
This commit is contained in:
@@ -300,6 +300,7 @@ message Property {
|
||||
Modality
|
||||
isNotDefault
|
||||
isExternal
|
||||
isInline
|
||||
*/
|
||||
optional int32 getter_flags = 7 /* absent => same as property */;
|
||||
optional int32 setter_flags = 8 /* absent => same as property */;
|
||||
|
||||
@@ -73,6 +73,7 @@ public class Flags {
|
||||
|
||||
public static final BooleanFlagField IS_NOT_DEFAULT = FlagField.booleanAfter(MODALITY);
|
||||
public static final BooleanFlagField IS_EXTERNAL_ACCESSOR = FlagField.booleanAfter(IS_NOT_DEFAULT);
|
||||
public static final BooleanFlagField IS_INLINE_ACCESSOR = FlagField.booleanAfter(IS_EXTERNAL_ACCESSOR);
|
||||
|
||||
// ---
|
||||
|
||||
@@ -180,13 +181,15 @@ public class Flags {
|
||||
@NotNull Visibility visibility,
|
||||
@NotNull Modality modality,
|
||||
boolean isNotDefault,
|
||||
boolean isExternal
|
||||
boolean isExternal,
|
||||
boolean isInlineAccessor
|
||||
) {
|
||||
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
||||
| MODALITY.toFlags(modality(modality))
|
||||
| VISIBILITY.toFlags(visibility(visibility))
|
||||
| IS_NOT_DEFAULT.toFlags(isNotDefault)
|
||||
| IS_EXTERNAL_ACCESSOR.toFlags(isExternal)
|
||||
| IS_INLINE_ACCESSOR.toFlags(isInlineAccessor)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -69,6 +69,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
val getterFlags = proto.getterFlags
|
||||
val isNotDefault = proto.hasGetterFlags() && Flags.IS_NOT_DEFAULT.get(getterFlags)
|
||||
val isExternal = proto.hasGetterFlags() && Flags.IS_EXTERNAL_ACCESSOR.get(getterFlags)
|
||||
val isInline = proto.hasGetterFlags() && Flags.IS_INLINE_ACCESSOR.get(getterFlags)
|
||||
val getter = if (isNotDefault) {
|
||||
PropertyGetterDescriptorImpl(
|
||||
property,
|
||||
@@ -77,6 +78,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
Deserialization.visibility(Flags.VISIBILITY.get(getterFlags)),
|
||||
/* isDefault = */ !isNotDefault,
|
||||
/* isExternal = */ isExternal,
|
||||
isInline,
|
||||
property.kind, null, SourceElement.NO_SOURCE
|
||||
)
|
||||
}
|
||||
@@ -94,6 +96,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
val setterFlags = proto.setterFlags
|
||||
val isNotDefault = proto.hasSetterFlags() && Flags.IS_NOT_DEFAULT.get(setterFlags)
|
||||
val isExternal = proto.hasSetterFlags() && Flags.IS_EXTERNAL_ACCESSOR.get(setterFlags)
|
||||
val isInline = proto.hasGetterFlags() && Flags.IS_INLINE_ACCESSOR.get(setterFlags)
|
||||
if (isNotDefault) {
|
||||
val setter = PropertySetterDescriptorImpl(
|
||||
property,
|
||||
@@ -102,6 +105,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
Deserialization.visibility(Flags.VISIBILITY.get(setterFlags)),
|
||||
/* isDefault = */ !isNotDefault,
|
||||
/* isExternal = */ isExternal,
|
||||
isInline,
|
||||
property.kind, null, SourceElement.NO_SOURCE
|
||||
)
|
||||
val setterLocal = local.childContext(setter, listOf())
|
||||
|
||||
Reference in New Issue
Block a user