Added 'isInline' implementation to property accessor descriptors
This commit is contained in:
+2
-2
@@ -95,7 +95,7 @@ public class AccessorForPropertyDescriptor extends PropertyDescriptorImpl implem
|
|||||||
public static class Getter extends PropertyGetterDescriptorImpl implements AccessorForCallableDescriptor<PropertyGetterDescriptor> {
|
public static class Getter extends PropertyGetterDescriptorImpl implements AccessorForCallableDescriptor<PropertyGetterDescriptor> {
|
||||||
public Getter(AccessorForPropertyDescriptor property) {
|
public Getter(AccessorForPropertyDescriptor property) {
|
||||||
super(property, Annotations.Companion.getEMPTY(), Modality.FINAL, Visibilities.LOCAL,
|
super(property, Annotations.Companion.getEMPTY(), Modality.FINAL, Visibilities.LOCAL,
|
||||||
/* isDefault = */ false, /* isExternal = */ false, Kind.DECLARATION, null, SourceElement.NO_SOURCE);
|
/* isDefault = */ false, /* isExternal = */ false, /* isInline = */false, Kind.DECLARATION, null, SourceElement.NO_SOURCE);
|
||||||
initialize(property.getType());
|
initialize(property.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ public class AccessorForPropertyDescriptor extends PropertyDescriptorImpl implem
|
|||||||
public static class Setter extends PropertySetterDescriptorImpl implements AccessorForCallableDescriptor<PropertySetterDescriptor>{
|
public static class Setter extends PropertySetterDescriptorImpl implements AccessorForCallableDescriptor<PropertySetterDescriptor>{
|
||||||
public Setter(AccessorForPropertyDescriptor property) {
|
public Setter(AccessorForPropertyDescriptor property) {
|
||||||
super(property, Annotations.Companion.getEMPTY(), Modality.FINAL, Visibilities.LOCAL,
|
super(property, Annotations.Companion.getEMPTY(), Modality.FINAL, Visibilities.LOCAL,
|
||||||
/* isDefault = */ false, /* isExternal = */ false, Kind.DECLARATION, null, SourceElement.NO_SOURCE);
|
/* isDefault = */ false, /* isExternal = */ false, /* isInline = */ false, Kind.DECLARATION, null, SourceElement.NO_SOURCE);
|
||||||
initializeDefault();
|
initializeDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
@@ -317,6 +317,7 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l
|
|||||||
visibility,
|
visibility,
|
||||||
false,
|
false,
|
||||||
getMethod.isExternal,
|
getMethod.isExternal,
|
||||||
|
false,
|
||||||
CallableMemberDescriptor.Kind.SYNTHESIZED,
|
CallableMemberDescriptor.Kind.SYNTHESIZED,
|
||||||
null,
|
null,
|
||||||
SourceElement.NO_SOURCE)
|
SourceElement.NO_SOURCE)
|
||||||
@@ -329,6 +330,7 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l
|
|||||||
syntheticExtensionVisibility(setMethod),
|
syntheticExtensionVisibility(setMethod),
|
||||||
false,
|
false,
|
||||||
setMethod.isExternal,
|
setMethod.isExternal,
|
||||||
|
false,
|
||||||
CallableMemberDescriptor.Kind.SYNTHESIZED,
|
CallableMemberDescriptor.Kind.SYNTHESIZED,
|
||||||
null,
|
null,
|
||||||
SourceElement.NO_SOURCE)
|
SourceElement.NO_SOURCE)
|
||||||
|
|||||||
@@ -925,6 +925,7 @@ public class DescriptorResolver {
|
|||||||
resolveModalityFromModifiers(setter, propertyDescriptor.getModality()),
|
resolveModalityFromModifiers(setter, propertyDescriptor.getModality()),
|
||||||
resolveVisibilityFromModifiers(setter, propertyDescriptor.getVisibility()),
|
resolveVisibilityFromModifiers(setter, propertyDescriptor.getVisibility()),
|
||||||
/* isDefault = */ false, setter.hasModifier(EXTERNAL_KEYWORD),
|
/* isDefault = */ false, setter.hasModifier(EXTERNAL_KEYWORD),
|
||||||
|
property.hasModifier(KtTokens.INLINE_KEYWORD) || setter.hasModifier(KtTokens.INLINE_KEYWORD),
|
||||||
CallableMemberDescriptor.Kind.DECLARATION, null, KotlinSourceElementKt.toSourceElement(setter)
|
CallableMemberDescriptor.Kind.DECLARATION, null, KotlinSourceElementKt.toSourceElement(setter)
|
||||||
);
|
);
|
||||||
KtTypeReference returnTypeReference = setter.getReturnTypeReference();
|
KtTypeReference returnTypeReference = setter.getReturnTypeReference();
|
||||||
@@ -973,7 +974,8 @@ public class DescriptorResolver {
|
|||||||
else if (property.isVar()) {
|
else if (property.isVar()) {
|
||||||
Annotations setterAnnotations = annotationSplitter.getAnnotationsForTarget(PROPERTY_SETTER);
|
Annotations setterAnnotations = annotationSplitter.getAnnotationsForTarget(PROPERTY_SETTER);
|
||||||
setterDescriptor = DescriptorFactory.createSetter(propertyDescriptor, setterAnnotations, !property.hasDelegate(),
|
setterDescriptor = DescriptorFactory.createSetter(propertyDescriptor, setterAnnotations, !property.hasDelegate(),
|
||||||
/* isExternal = */ false, propertyDescriptor.getSource());
|
/* isExternal = */ false, property.hasModifier(KtTokens.INLINE_KEYWORD),
|
||||||
|
propertyDescriptor.getSource());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!property.isVar()) {
|
if (!property.isVar()) {
|
||||||
@@ -1005,6 +1007,7 @@ public class DescriptorResolver {
|
|||||||
resolveModalityFromModifiers(getter, propertyDescriptor.getModality()),
|
resolveModalityFromModifiers(getter, propertyDescriptor.getModality()),
|
||||||
resolveVisibilityFromModifiers(getter, propertyDescriptor.getVisibility()),
|
resolveVisibilityFromModifiers(getter, propertyDescriptor.getVisibility()),
|
||||||
/* isDefault = */ false, getter.hasModifier(EXTERNAL_KEYWORD),
|
/* isDefault = */ false, getter.hasModifier(EXTERNAL_KEYWORD),
|
||||||
|
property.hasModifier(KtTokens.INLINE_KEYWORD) || getter.hasModifier(KtTokens.INLINE_KEYWORD),
|
||||||
CallableMemberDescriptor.Kind.DECLARATION, null, KotlinSourceElementKt.toSourceElement(getter)
|
CallableMemberDescriptor.Kind.DECLARATION, null, KotlinSourceElementKt.toSourceElement(getter)
|
||||||
);
|
);
|
||||||
KotlinType returnType =
|
KotlinType returnType =
|
||||||
@@ -1015,7 +1018,7 @@ public class DescriptorResolver {
|
|||||||
else {
|
else {
|
||||||
Annotations getterAnnotations = annotationSplitter.getAnnotationsForTarget(PROPERTY_GETTER);
|
Annotations getterAnnotations = annotationSplitter.getAnnotationsForTarget(PROPERTY_GETTER);
|
||||||
getterDescriptor = DescriptorFactory.createGetter(propertyDescriptor, getterAnnotations, !property.hasDelegate(),
|
getterDescriptor = DescriptorFactory.createGetter(propertyDescriptor, getterAnnotations, !property.hasDelegate(),
|
||||||
/* isExternal = */ false);
|
/* isExternal = */ false, property.hasModifier(KtTokens.INLINE_KEYWORD));
|
||||||
getterDescriptor.initialize(propertyDescriptor.getType());
|
getterDescriptor.initialize(propertyDescriptor.getType());
|
||||||
}
|
}
|
||||||
return getterDescriptor;
|
return getterDescriptor;
|
||||||
|
|||||||
+3
-2
@@ -141,7 +141,7 @@ class DescriptorSerializer private constructor(
|
|||||||
|
|
||||||
val hasAnnotations = descriptor.annotations.getAllAnnotations().isNotEmpty()
|
val hasAnnotations = descriptor.annotations.getAllAnnotations().isNotEmpty()
|
||||||
|
|
||||||
val propertyFlags = Flags.getAccessorFlags(hasAnnotations, descriptor.visibility, descriptor.modality, false, false)
|
val propertyFlags = Flags.getAccessorFlags(hasAnnotations, descriptor.visibility, descriptor.modality, false, false, false)
|
||||||
|
|
||||||
val getter = descriptor.getter
|
val getter = descriptor.getter
|
||||||
if (getter != null) {
|
if (getter != null) {
|
||||||
@@ -593,7 +593,8 @@ class DescriptorSerializer private constructor(
|
|||||||
accessor.visibility,
|
accessor.visibility,
|
||||||
accessor.modality,
|
accessor.modality,
|
||||||
!accessor.isDefault,
|
!accessor.isDefault,
|
||||||
accessor.isExternal
|
accessor.isExternal,
|
||||||
|
accessor.isInline
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -112,7 +112,7 @@ public class JavaPropertyDescriptor extends PropertyDescriptorImpl implements Ja
|
|||||||
if (getter != null) {
|
if (getter != null) {
|
||||||
newGetter = new PropertyGetterDescriptorImpl(
|
newGetter = new PropertyGetterDescriptorImpl(
|
||||||
enhanced, getter.getAnnotations(), getter.getModality(), getter.getVisibility(),
|
enhanced, getter.getAnnotations(), getter.getModality(), getter.getVisibility(),
|
||||||
getter.isDefault(), getter.isExternal(), getKind(), getter, getter.getSource()
|
getter.isDefault(), getter.isExternal(), getter.isInline(), getKind(), getter, getter.getSource()
|
||||||
);
|
);
|
||||||
newGetter.setInitialSignatureDescriptor(getter.getInitialSignatureDescriptor());
|
newGetter.setInitialSignatureDescriptor(getter.getInitialSignatureDescriptor());
|
||||||
newGetter.initialize(enhancedReturnType);
|
newGetter.initialize(enhancedReturnType);
|
||||||
@@ -123,7 +123,7 @@ public class JavaPropertyDescriptor extends PropertyDescriptorImpl implements Ja
|
|||||||
if (setter != null) {
|
if (setter != null) {
|
||||||
newSetter = new PropertySetterDescriptorImpl(
|
newSetter = new PropertySetterDescriptorImpl(
|
||||||
enhanced, setter.getAnnotations(), setter.getModality(), setter.getVisibility(),
|
enhanced, setter.getAnnotations(), setter.getModality(), setter.getVisibility(),
|
||||||
setter.isDefault(), setter.isExternal(), getKind(), setter, setter.getSource()
|
setter.isDefault(), setter.isExternal(), setter.isInline(), getKind(), setter, setter.getSource()
|
||||||
);
|
);
|
||||||
newSetter.setInitialSignatureDescriptor(newSetter.getInitialSignatureDescriptor());
|
newSetter.setInitialSignatureDescriptor(newSetter.getInitialSignatureDescriptor());
|
||||||
newSetter.initialize(setter.getValueParameters().get(0));
|
newSetter.initialize(setter.getValueParameters().get(0));
|
||||||
|
|||||||
+2
-2
@@ -444,7 +444,7 @@ class LazyJavaClassMemberScope(
|
|||||||
|
|
||||||
val getter = DescriptorFactory.createGetter(
|
val getter = DescriptorFactory.createGetter(
|
||||||
propertyDescriptor, getterMethod.annotations, /* isDefault = */false,
|
propertyDescriptor, getterMethod.annotations, /* isDefault = */false,
|
||||||
/* isExternal = */ false, getterMethod.source
|
/* isExternal = */ false, /* isInline = */ false, getterMethod.source
|
||||||
).apply {
|
).apply {
|
||||||
initialSignatureDescriptor = getterMethod
|
initialSignatureDescriptor = getterMethod
|
||||||
initialize(propertyDescriptor.type)
|
initialize(propertyDescriptor.type)
|
||||||
@@ -452,7 +452,7 @@ class LazyJavaClassMemberScope(
|
|||||||
|
|
||||||
val setter = setterMethod?.let { setterMethod ->
|
val setter = setterMethod?.let { setterMethod ->
|
||||||
DescriptorFactory.createSetter(propertyDescriptor, setterMethod.annotations, /* isDefault = */false,
|
DescriptorFactory.createSetter(propertyDescriptor, setterMethod.annotations, /* isDefault = */false,
|
||||||
/* isExternal = */ false, setterMethod.visibility, setterMethod.source
|
/* isExternal = */ false, /* isInline = */ false, setterMethod.visibility, setterMethod.source
|
||||||
).apply {
|
).apply {
|
||||||
initialSignatureDescriptor = setterMethod
|
initialSignatureDescriptor = setterMethod
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -33,6 +33,7 @@ public abstract class PropertyAccessorDescriptorImpl extends DeclarationDescript
|
|||||||
private final boolean isExternal;
|
private final boolean isExternal;
|
||||||
private final Modality modality;
|
private final Modality modality;
|
||||||
private final PropertyDescriptor correspondingProperty;
|
private final PropertyDescriptor correspondingProperty;
|
||||||
|
private final boolean isInline;
|
||||||
private final Kind kind;
|
private final Kind kind;
|
||||||
private Visibility visibility;
|
private Visibility visibility;
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -46,6 +47,7 @@ public abstract class PropertyAccessorDescriptorImpl extends DeclarationDescript
|
|||||||
@NotNull Name name,
|
@NotNull Name name,
|
||||||
boolean isDefault,
|
boolean isDefault,
|
||||||
boolean isExternal,
|
boolean isExternal,
|
||||||
|
boolean isInline,
|
||||||
Kind kind,
|
Kind kind,
|
||||||
@NotNull SourceElement source
|
@NotNull SourceElement source
|
||||||
) {
|
) {
|
||||||
@@ -55,6 +57,7 @@ public abstract class PropertyAccessorDescriptorImpl extends DeclarationDescript
|
|||||||
this.correspondingProperty = correspondingProperty;
|
this.correspondingProperty = correspondingProperty;
|
||||||
this.isDefault = isDefault;
|
this.isDefault = isDefault;
|
||||||
this.isExternal = isExternal;
|
this.isExternal = isExternal;
|
||||||
|
this.isInline = isInline;
|
||||||
this.kind = kind;
|
this.kind = kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +89,7 @@ public abstract class PropertyAccessorDescriptorImpl extends DeclarationDescript
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInline() {
|
public boolean isInline() {
|
||||||
return false;
|
return isInline;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
-2
@@ -260,7 +260,7 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
|||||||
|
|
||||||
PropertyGetterDescriptorImpl newGetter = getter == null ? null : new PropertyGetterDescriptorImpl(
|
PropertyGetterDescriptorImpl newGetter = getter == null ? null : new PropertyGetterDescriptorImpl(
|
||||||
substitutedDescriptor, getter.getAnnotations(), newModality, normalizeVisibility(getter.getVisibility(), kind),
|
substitutedDescriptor, getter.getAnnotations(), newModality, normalizeVisibility(getter.getVisibility(), kind),
|
||||||
getter.isDefault(), getter.isExternal(), kind, original == null ? null : original.getGetter(),
|
getter.isDefault(), getter.isExternal(), getter.isInline(), kind, original == null ? null : original.getGetter(),
|
||||||
SourceElement.NO_SOURCE
|
SourceElement.NO_SOURCE
|
||||||
);
|
);
|
||||||
if (newGetter != null) {
|
if (newGetter != null) {
|
||||||
@@ -270,7 +270,7 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
|||||||
}
|
}
|
||||||
PropertySetterDescriptorImpl newSetter = setter == null ? null : new PropertySetterDescriptorImpl(
|
PropertySetterDescriptorImpl newSetter = setter == null ? null : new PropertySetterDescriptorImpl(
|
||||||
substitutedDescriptor, setter.getAnnotations(), newModality, normalizeVisibility(setter.getVisibility(), kind),
|
substitutedDescriptor, setter.getAnnotations(), newModality, normalizeVisibility(setter.getVisibility(), kind),
|
||||||
setter.isDefault(), setter.isExternal(), kind, original == null ? null : original.getSetter(),
|
setter.isDefault(), setter.isExternal(), setter.isInline(), kind, original == null ? null : original.getSetter(),
|
||||||
SourceElement.NO_SOURCE
|
SourceElement.NO_SOURCE
|
||||||
);
|
);
|
||||||
if (newSetter != null) {
|
if (newSetter != null) {
|
||||||
|
|||||||
+2
-1
@@ -40,12 +40,13 @@ public class PropertyGetterDescriptorImpl extends PropertyAccessorDescriptorImpl
|
|||||||
@NotNull Visibility visibility,
|
@NotNull Visibility visibility,
|
||||||
boolean isDefault,
|
boolean isDefault,
|
||||||
boolean isExternal,
|
boolean isExternal,
|
||||||
|
boolean isInline,
|
||||||
@NotNull Kind kind,
|
@NotNull Kind kind,
|
||||||
@Nullable PropertyGetterDescriptor original,
|
@Nullable PropertyGetterDescriptor original,
|
||||||
@NotNull SourceElement source
|
@NotNull SourceElement source
|
||||||
) {
|
) {
|
||||||
super(modality, visibility, correspondingProperty, annotations, Name.special("<get-" + correspondingProperty.getName() + ">"),
|
super(modality, visibility, correspondingProperty, annotations, Name.special("<get-" + correspondingProperty.getName() + ">"),
|
||||||
isDefault, isExternal, kind, source);
|
isDefault, isExternal, isInline, kind, source);
|
||||||
this.original = original != null ? original : this;
|
this.original = original != null ? original : this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -42,12 +42,13 @@ public class PropertySetterDescriptorImpl extends PropertyAccessorDescriptorImpl
|
|||||||
@NotNull Visibility visibility,
|
@NotNull Visibility visibility,
|
||||||
boolean isDefault,
|
boolean isDefault,
|
||||||
boolean isExternal,
|
boolean isExternal,
|
||||||
|
boolean isInline,
|
||||||
@NotNull Kind kind,
|
@NotNull Kind kind,
|
||||||
@Nullable PropertySetterDescriptor original,
|
@Nullable PropertySetterDescriptor original,
|
||||||
@NotNull SourceElement source
|
@NotNull SourceElement source
|
||||||
) {
|
) {
|
||||||
super(modality, visibility, correspondingProperty, annotations, Name.special("<set-" + correspondingProperty.getName() + ">"),
|
super(modality, visibility, correspondingProperty, annotations, Name.special("<set-" + correspondingProperty.getName() + ">"),
|
||||||
isDefault, isExternal, kind, source);
|
isDefault, isExternal, isInline, kind, source);
|
||||||
this.original = original != null ? original : this;
|
this.original = original != null ? original : this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,4 +108,5 @@ public class PropertySetterDescriptorImpl extends PropertyAccessorDescriptorImpl
|
|||||||
public PropertySetterDescriptor getOriginal() {
|
public PropertySetterDescriptor getOriginal() {
|
||||||
return this.original;
|
return this.original;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class DescriptorFactory {
|
|||||||
@NotNull PropertyDescriptor propertyDescriptor,
|
@NotNull PropertyDescriptor propertyDescriptor,
|
||||||
@NotNull Annotations annotations
|
@NotNull Annotations annotations
|
||||||
) {
|
) {
|
||||||
return createSetter(propertyDescriptor, annotations, true, false, propertyDescriptor.getSource());
|
return createSetter(propertyDescriptor, annotations, true, false, false, propertyDescriptor.getSource());
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -57,9 +57,10 @@ public class DescriptorFactory {
|
|||||||
@NotNull Annotations annotations,
|
@NotNull Annotations annotations,
|
||||||
boolean isDefault,
|
boolean isDefault,
|
||||||
boolean isExternal,
|
boolean isExternal,
|
||||||
|
boolean isInline,
|
||||||
@NotNull SourceElement sourceElement
|
@NotNull SourceElement sourceElement
|
||||||
) {
|
) {
|
||||||
return createSetter(propertyDescriptor, annotations, isDefault, isExternal, propertyDescriptor.getVisibility(), sourceElement);
|
return createSetter(propertyDescriptor, annotations, isDefault, isExternal, isInline, propertyDescriptor.getVisibility(), sourceElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -68,12 +69,13 @@ public class DescriptorFactory {
|
|||||||
@NotNull Annotations annotations,
|
@NotNull Annotations annotations,
|
||||||
boolean isDefault,
|
boolean isDefault,
|
||||||
boolean isExternal,
|
boolean isExternal,
|
||||||
|
boolean isInline,
|
||||||
@NotNull Visibility visibility,
|
@NotNull Visibility visibility,
|
||||||
@NotNull SourceElement sourceElement
|
@NotNull SourceElement sourceElement
|
||||||
) {
|
) {
|
||||||
PropertySetterDescriptorImpl setterDescriptor = new PropertySetterDescriptorImpl(
|
PropertySetterDescriptorImpl setterDescriptor = new PropertySetterDescriptorImpl(
|
||||||
propertyDescriptor, annotations, propertyDescriptor.getModality(), visibility, isDefault, isExternal,
|
propertyDescriptor, annotations, propertyDescriptor.getModality(), visibility, isDefault, isExternal,
|
||||||
CallableMemberDescriptor.Kind.DECLARATION, null, sourceElement
|
isInline, CallableMemberDescriptor.Kind.DECLARATION, null, sourceElement
|
||||||
);
|
);
|
||||||
setterDescriptor.initializeDefault();
|
setterDescriptor.initializeDefault();
|
||||||
return setterDescriptor;
|
return setterDescriptor;
|
||||||
@@ -84,17 +86,7 @@ public class DescriptorFactory {
|
|||||||
@NotNull PropertyDescriptor propertyDescriptor,
|
@NotNull PropertyDescriptor propertyDescriptor,
|
||||||
@NotNull Annotations annotations
|
@NotNull Annotations annotations
|
||||||
) {
|
) {
|
||||||
return createGetter(propertyDescriptor, annotations, true, false);
|
return createGetter(propertyDescriptor, annotations, true, false, false);
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static PropertyGetterDescriptorImpl createGetter(
|
|
||||||
@NotNull PropertyDescriptor propertyDescriptor,
|
|
||||||
@NotNull Annotations annotations,
|
|
||||||
boolean isDefault,
|
|
||||||
boolean isExternal
|
|
||||||
) {
|
|
||||||
return createGetter(propertyDescriptor, annotations, isDefault, isExternal, propertyDescriptor.getSource());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -103,11 +95,23 @@ public class DescriptorFactory {
|
|||||||
@NotNull Annotations annotations,
|
@NotNull Annotations annotations,
|
||||||
boolean isDefault,
|
boolean isDefault,
|
||||||
boolean isExternal,
|
boolean isExternal,
|
||||||
|
boolean isInline
|
||||||
|
) {
|
||||||
|
return createGetter(propertyDescriptor, annotations, isDefault, isExternal, isInline, propertyDescriptor.getSource());
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static PropertyGetterDescriptorImpl createGetter(
|
||||||
|
@NotNull PropertyDescriptor propertyDescriptor,
|
||||||
|
@NotNull Annotations annotations,
|
||||||
|
boolean isDefault,
|
||||||
|
boolean isExternal,
|
||||||
|
boolean isInline,
|
||||||
@NotNull SourceElement sourceElement
|
@NotNull SourceElement sourceElement
|
||||||
) {
|
) {
|
||||||
return new PropertyGetterDescriptorImpl(
|
return new PropertyGetterDescriptorImpl(
|
||||||
propertyDescriptor, annotations, propertyDescriptor.getModality(), propertyDescriptor.getVisibility(),
|
propertyDescriptor, annotations, propertyDescriptor.getModality(), propertyDescriptor.getVisibility(),
|
||||||
isDefault, isExternal, CallableMemberDescriptor.Kind.DECLARATION, null, sourceElement
|
isDefault, isExternal, isInline, CallableMemberDescriptor.Kind.DECLARATION, null, sourceElement
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ message Property {
|
|||||||
Modality
|
Modality
|
||||||
isNotDefault
|
isNotDefault
|
||||||
isExternal
|
isExternal
|
||||||
|
isInline
|
||||||
*/
|
*/
|
||||||
optional int32 getter_flags = 7 /* absent => same as property */;
|
optional int32 getter_flags = 7 /* absent => same as property */;
|
||||||
optional int32 setter_flags = 8 /* 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_NOT_DEFAULT = FlagField.booleanAfter(MODALITY);
|
||||||
public static final BooleanFlagField IS_EXTERNAL_ACCESSOR = FlagField.booleanAfter(IS_NOT_DEFAULT);
|
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 Visibility visibility,
|
||||||
@NotNull Modality modality,
|
@NotNull Modality modality,
|
||||||
boolean isNotDefault,
|
boolean isNotDefault,
|
||||||
boolean isExternal
|
boolean isExternal,
|
||||||
|
boolean isInlineAccessor
|
||||||
) {
|
) {
|
||||||
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
||||||
| MODALITY.toFlags(modality(modality))
|
| MODALITY.toFlags(modality(modality))
|
||||||
| VISIBILITY.toFlags(visibility(visibility))
|
| VISIBILITY.toFlags(visibility(visibility))
|
||||||
| IS_NOT_DEFAULT.toFlags(isNotDefault)
|
| IS_NOT_DEFAULT.toFlags(isNotDefault)
|
||||||
| IS_EXTERNAL_ACCESSOR.toFlags(isExternal)
|
| 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 getterFlags = proto.getterFlags
|
||||||
val isNotDefault = proto.hasGetterFlags() && Flags.IS_NOT_DEFAULT.get(getterFlags)
|
val isNotDefault = proto.hasGetterFlags() && Flags.IS_NOT_DEFAULT.get(getterFlags)
|
||||||
val isExternal = proto.hasGetterFlags() && Flags.IS_EXTERNAL_ACCESSOR.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) {
|
val getter = if (isNotDefault) {
|
||||||
PropertyGetterDescriptorImpl(
|
PropertyGetterDescriptorImpl(
|
||||||
property,
|
property,
|
||||||
@@ -77,6 +78,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
|||||||
Deserialization.visibility(Flags.VISIBILITY.get(getterFlags)),
|
Deserialization.visibility(Flags.VISIBILITY.get(getterFlags)),
|
||||||
/* isDefault = */ !isNotDefault,
|
/* isDefault = */ !isNotDefault,
|
||||||
/* isExternal = */ isExternal,
|
/* isExternal = */ isExternal,
|
||||||
|
isInline,
|
||||||
property.kind, null, SourceElement.NO_SOURCE
|
property.kind, null, SourceElement.NO_SOURCE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -94,6 +96,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
|||||||
val setterFlags = proto.setterFlags
|
val setterFlags = proto.setterFlags
|
||||||
val isNotDefault = proto.hasSetterFlags() && Flags.IS_NOT_DEFAULT.get(setterFlags)
|
val isNotDefault = proto.hasSetterFlags() && Flags.IS_NOT_DEFAULT.get(setterFlags)
|
||||||
val isExternal = proto.hasSetterFlags() && Flags.IS_EXTERNAL_ACCESSOR.get(setterFlags)
|
val isExternal = proto.hasSetterFlags() && Flags.IS_EXTERNAL_ACCESSOR.get(setterFlags)
|
||||||
|
val isInline = proto.hasGetterFlags() && Flags.IS_INLINE_ACCESSOR.get(setterFlags)
|
||||||
if (isNotDefault) {
|
if (isNotDefault) {
|
||||||
val setter = PropertySetterDescriptorImpl(
|
val setter = PropertySetterDescriptorImpl(
|
||||||
property,
|
property,
|
||||||
@@ -102,6 +105,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
|||||||
Deserialization.visibility(Flags.VISIBILITY.get(setterFlags)),
|
Deserialization.visibility(Flags.VISIBILITY.get(setterFlags)),
|
||||||
/* isDefault = */ !isNotDefault,
|
/* isDefault = */ !isNotDefault,
|
||||||
/* isExternal = */ isExternal,
|
/* isExternal = */ isExternal,
|
||||||
|
isInline,
|
||||||
property.kind, null, SourceElement.NO_SOURCE
|
property.kind, null, SourceElement.NO_SOURCE
|
||||||
)
|
)
|
||||||
val setterLocal = local.childContext(setter, listOf())
|
val setterLocal = local.childContext(setter, listOf())
|
||||||
|
|||||||
+1
@@ -123,6 +123,7 @@ private fun genProperty(
|
|||||||
Visibilities.PUBLIC,
|
Visibilities.PUBLIC,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
|
false,
|
||||||
CallableMemberDescriptor.Kind.SYNTHESIZED,
|
CallableMemberDescriptor.Kind.SYNTHESIZED,
|
||||||
null,
|
null,
|
||||||
SourceElement.NO_SOURCE
|
SourceElement.NO_SOURCE
|
||||||
|
|||||||
Reference in New Issue
Block a user