lateinit modifier on property
This commit is contained in:
@@ -250,6 +250,7 @@ message Callable {
|
||||
hasGetter
|
||||
hasSetter
|
||||
hasConstant
|
||||
lateinit
|
||||
*/
|
||||
optional int32 flags = 1;
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ public class Flags {
|
||||
public static final FlagField<Boolean> HAS_SETTER = FlagField.booleanAfter(HAS_GETTER);
|
||||
public static final FlagField<Boolean> HAS_CONSTANT = FlagField.booleanAfter(HAS_SETTER);
|
||||
|
||||
public static final FlagField<Boolean> LATE_INIT = FlagField.booleanAfter(HAS_CONSTANT);
|
||||
|
||||
// Parameters
|
||||
|
||||
public static final FlagField<Boolean> DECLARES_DEFAULT_VALUE = FlagField.booleanAfter(HAS_ANNOTATIONS);
|
||||
@@ -112,7 +114,8 @@ public class Flags {
|
||||
@NotNull ProtoBuf.Callable.CallableKind callableKind,
|
||||
boolean hasGetter,
|
||||
boolean hasSetter,
|
||||
boolean hasConstant
|
||||
boolean hasConstant,
|
||||
boolean lateInit
|
||||
) {
|
||||
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
||||
| MODALITY.toFlags(modality(modality))
|
||||
@@ -122,6 +125,7 @@ public class Flags {
|
||||
| HAS_GETTER.toFlags(hasGetter)
|
||||
| HAS_SETTER.toFlags(hasSetter)
|
||||
| HAS_CONSTANT.toFlags(hasConstant)
|
||||
| LATE_INIT.toFlags(lateInit)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -45,6 +45,8 @@ public class MemberDeserializer(private val c: DeserializationContext) {
|
||||
private fun loadProperty(proto: Callable): PropertyDescriptor {
|
||||
val flags = proto.getFlags()
|
||||
|
||||
val lateInit = Flags.LATE_INIT.get(flags)
|
||||
|
||||
val property = DeserializedPropertyDescriptor(
|
||||
c.containingDeclaration, null,
|
||||
getAnnotations(proto, flags, AnnotatedCallableKind.PROPERTY),
|
||||
@@ -54,7 +56,8 @@ public class MemberDeserializer(private val c: DeserializationContext) {
|
||||
c.nameResolver.getName(proto.getName()),
|
||||
memberKind(Flags.MEMBER_KIND.get(flags)),
|
||||
proto,
|
||||
c.nameResolver
|
||||
c.nameResolver,
|
||||
Flags.LATE_INIT.get(flags)
|
||||
)
|
||||
|
||||
val local = c.childContext(property, proto.getTypeParameterList())
|
||||
|
||||
+5
-3
@@ -38,9 +38,11 @@ public class DeserializedPropertyDescriptor(
|
||||
name: Name,
|
||||
kind: Kind,
|
||||
override public val proto: ProtoBuf.Callable,
|
||||
override public val nameResolver: NameResolver
|
||||
override public val nameResolver: NameResolver,
|
||||
lateInit: Boolean
|
||||
) : DeserializedCallableMemberDescriptor,
|
||||
PropertyDescriptorImpl(containingDeclaration, original, annotations, modality, visibility, isVar, name, kind, SourceElement.NO_SOURCE) {
|
||||
PropertyDescriptorImpl(containingDeclaration, original, annotations,
|
||||
modality, visibility, isVar, name, kind, SourceElement.NO_SOURCE, lateInit) {
|
||||
|
||||
override fun createSubstitutedCopy(
|
||||
newOwner: DeclarationDescriptor,
|
||||
@@ -50,6 +52,6 @@ public class DeserializedPropertyDescriptor(
|
||||
kind: Kind
|
||||
): PropertyDescriptorImpl {
|
||||
return DeserializedPropertyDescriptor(
|
||||
newOwner, original, getAnnotations(), newModality, newVisibility, isVar(), getName(), kind, proto, nameResolver)
|
||||
newOwner, original, annotations, newModality, newVisibility, isVar, name, kind, proto, nameResolver, isLateInit)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user