Rename isHeader to isExpect in descriptors
This commit is contained in:
committed by
Mikhail Glukhikh
parent
fd6eab38e5
commit
c8ee424f67
+1
-1
@@ -102,7 +102,7 @@ class LazyJavaClassDescriptor(
|
||||
override fun isInner() = isInner
|
||||
override fun isData() = false
|
||||
override fun isCompanionObject() = false
|
||||
override fun isHeader() = false
|
||||
override fun isExpect() = false
|
||||
override fun isImpl() = false
|
||||
|
||||
private val typeConstructor = LazyJavaClassTypeConstructor()
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ class FunctionClassDescriptor(
|
||||
override fun isCompanionObject() = false
|
||||
override fun isInner() = false
|
||||
override fun isData() = false
|
||||
override fun isHeader() = false
|
||||
override fun isExpect() = false
|
||||
override fun isImpl() = false
|
||||
override fun isExternal() = false
|
||||
override val annotations: Annotations get() = Annotations.EMPTY
|
||||
|
||||
@@ -26,7 +26,7 @@ public interface MemberDescriptor extends DeclarationDescriptorNonRoot, Declarat
|
||||
@NotNull
|
||||
Visibility getVisibility();
|
||||
|
||||
boolean isHeader();
|
||||
boolean isExpect();
|
||||
|
||||
boolean isImpl();
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo
|
||||
|
||||
override fun isCompanionObject() = false
|
||||
override fun isData() = false
|
||||
override fun isHeader() = false
|
||||
override fun isExpect() = false
|
||||
override fun isImpl() = false
|
||||
override fun isExternal() = false
|
||||
override val annotations: Annotations get() = Annotations.EMPTY
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ abstract class AbstractTypeAliasDescriptor(
|
||||
|
||||
override fun getVisibility() = visibilityImpl
|
||||
|
||||
override fun isHeader(): Boolean = false
|
||||
override fun isExpect(): Boolean = false
|
||||
|
||||
override fun isImpl(): Boolean = false
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ public class ClassDescriptorImpl extends ClassDescriptorBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHeader() {
|
||||
public boolean isExpect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ public class EnumEntrySyntheticClassDescriptor extends ClassDescriptorBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHeader() {
|
||||
public boolean isExpect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -43,7 +43,7 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
private boolean isExternal = false;
|
||||
private boolean isInline = false;
|
||||
private boolean isTailrec = false;
|
||||
private boolean isHeader = false;
|
||||
private boolean isExpect = false;
|
||||
private boolean isImpl = false;
|
||||
// Difference between these hidden kinds:
|
||||
// 1. isHiddenToOvercomeSignatureClash prohibit calling such functions even in super-call context
|
||||
@@ -136,8 +136,8 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
this.isTailrec = isTailrec;
|
||||
}
|
||||
|
||||
public void setHeader(boolean isHeader) {
|
||||
this.isHeader = isHeader;
|
||||
public void setExpect(boolean isExpect) {
|
||||
this.isExpect = isExpect;
|
||||
}
|
||||
|
||||
public void setImpl(boolean isImpl) {
|
||||
@@ -258,8 +258,8 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHeader() {
|
||||
return isHeader;
|
||||
public boolean isExpect() {
|
||||
return isExpect;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -664,7 +664,7 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
substitutedDescriptor.setInline(isInline);
|
||||
substitutedDescriptor.setTailrec(isTailrec);
|
||||
substitutedDescriptor.setSuspend(isSuspend);
|
||||
substitutedDescriptor.setHeader(isHeader);
|
||||
substitutedDescriptor.setExpect(isExpect);
|
||||
substitutedDescriptor.setImpl(isImpl);
|
||||
substitutedDescriptor.setHasStableParameterNames(hasStableParameterNames);
|
||||
substitutedDescriptor.setHiddenToOvercomeSignatureClash(configuration.isHiddenToOvercomeSignatureClash);
|
||||
|
||||
+2
-2
@@ -227,8 +227,8 @@ public class LazySubstitutingClassDescriptor implements ClassDescriptor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHeader() {
|
||||
return original.isHeader();
|
||||
public boolean isExpect() {
|
||||
return original.isExpect();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ public class MutableClassDescriptor extends ClassDescriptorBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHeader() {
|
||||
public boolean isExpect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ public abstract class PropertyAccessorDescriptorImpl extends DeclarationDescript
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHeader() {
|
||||
public boolean isExpect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -42,7 +42,7 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
private final Kind kind;
|
||||
private final boolean lateInit;
|
||||
private final boolean isConst;
|
||||
private final boolean isHeader;
|
||||
private final boolean isExpect;
|
||||
private final boolean isImpl;
|
||||
private final boolean isExternal;
|
||||
private final boolean isDelegated;
|
||||
@@ -66,7 +66,7 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
@NotNull SourceElement source,
|
||||
boolean lateInit,
|
||||
boolean isConst,
|
||||
boolean isHeader,
|
||||
boolean isExpect,
|
||||
boolean isImpl,
|
||||
boolean isExternal,
|
||||
boolean isDelegated
|
||||
@@ -78,7 +78,7 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
this.kind = kind;
|
||||
this.lateInit = lateInit;
|
||||
this.isConst = isConst;
|
||||
this.isHeader = isHeader;
|
||||
this.isExpect = isExpect;
|
||||
this.isImpl = isImpl;
|
||||
this.isExternal = isExternal;
|
||||
this.isDelegated = isDelegated;
|
||||
@@ -96,14 +96,14 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
@NotNull SourceElement source,
|
||||
boolean lateInit,
|
||||
boolean isConst,
|
||||
boolean isHeader,
|
||||
boolean isExpect,
|
||||
boolean isImpl,
|
||||
boolean isExternal,
|
||||
boolean isDelegated
|
||||
) {
|
||||
return new PropertyDescriptorImpl(containingDeclaration, null, annotations,
|
||||
modality, visibility, isVar, name, kind, source, lateInit, isConst,
|
||||
isHeader, isImpl, isExternal, isDelegated);
|
||||
isExpect, isImpl, isExternal, isDelegated);
|
||||
}
|
||||
|
||||
public void setType(
|
||||
@@ -458,7 +458,7 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
) {
|
||||
return new PropertyDescriptorImpl(
|
||||
newOwner, original, getAnnotations(), newModality, newVisibility, isVar(), newName, kind, SourceElement.NO_SOURCE,
|
||||
isLateInit(), isConst(), isHeader(), isImpl(), isExternal(), isDelegated()
|
||||
isLateInit(), isConst(), isExpect(), isImpl(), isExternal(), isDelegated()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -480,8 +480,8 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHeader() {
|
||||
return isHeader;
|
||||
public boolean isExpect() {
|
||||
return isExpect;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -509,7 +509,7 @@ internal class DescriptorRendererImpl(
|
||||
|
||||
private fun renderMemberModifiers(descriptor: MemberDescriptor, builder: StringBuilder) {
|
||||
renderModifier(builder, descriptor.isExternal, "external")
|
||||
renderModifier(builder, DescriptorRendererModifier.HEADER in modifiers && descriptor.isHeader, "header")
|
||||
renderModifier(builder, DescriptorRendererModifier.HEADER in modifiers && descriptor.isExpect, "header")
|
||||
renderModifier(builder, DescriptorRendererModifier.IMPL in modifiers && descriptor.isImpl, "impl")
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ inline fun <Scope, T : ClassifierDescriptor> getFirstClassifierDiscriminateHeade
|
||||
for (scope in scopes) {
|
||||
val newResult = callback(scope)
|
||||
if (newResult != null) {
|
||||
if (newResult is ClassifierDescriptorWithTypeParameters && newResult.isHeader) {
|
||||
if (newResult is ClassifierDescriptorWithTypeParameters && newResult.isExpect) {
|
||||
if (result == null) result = newResult
|
||||
}
|
||||
// this class is Impl or usual class
|
||||
|
||||
@@ -98,7 +98,7 @@ public class Flags {
|
||||
boolean isCompanionObject,
|
||||
boolean isData,
|
||||
boolean isExternal,
|
||||
boolean isHeader
|
||||
boolean isExpect
|
||||
) {
|
||||
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
||||
| MODALITY.toFlags(modality(modality))
|
||||
@@ -107,7 +107,7 @@ public class Flags {
|
||||
| IS_INNER.toFlags(inner)
|
||||
| IS_DATA.toFlags(isData)
|
||||
| IS_EXTERNAL_CLASS.toFlags(isExternal)
|
||||
| IS_HEADER_CLASS.toFlags(isHeader)
|
||||
| IS_HEADER_CLASS.toFlags(isExpect)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public class Flags {
|
||||
boolean isTailrec,
|
||||
boolean isExternal,
|
||||
boolean isSuspend,
|
||||
boolean isHeader
|
||||
boolean isExpect
|
||||
) {
|
||||
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
||||
| VISIBILITY.toFlags(visibility(visibility))
|
||||
@@ -165,7 +165,7 @@ public class Flags {
|
||||
| IS_TAILREC.toFlags(isTailrec)
|
||||
| IS_EXTERNAL_FUNCTION.toFlags(isExternal)
|
||||
| IS_SUSPEND.toFlags(isSuspend)
|
||||
| IS_HEADER_FUNCTION.toFlags(isHeader)
|
||||
| IS_HEADER_FUNCTION.toFlags(isExpect)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public class Flags {
|
||||
boolean lateInit,
|
||||
boolean isExternal,
|
||||
boolean isDelegated,
|
||||
boolean isHeader
|
||||
boolean isExpect
|
||||
) {
|
||||
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
||||
| VISIBILITY.toFlags(visibility(visibility))
|
||||
@@ -196,7 +196,7 @@ public class Flags {
|
||||
| HAS_CONSTANT.toFlags(hasConstant)
|
||||
| IS_EXTERNAL_PROPERTY.toFlags(isExternal)
|
||||
| IS_DELEGATED.toFlags(isDelegated)
|
||||
| IS_HEADER_PROPERTY.toFlags(isHeader)
|
||||
| IS_HEADER_PROPERTY.toFlags(isExpect)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
function.isInline = Flags.IS_INLINE.get(flags)
|
||||
function.isTailrec = Flags.IS_TAILREC.get(flags)
|
||||
function.isSuspend = Flags.IS_SUSPEND.get(flags)
|
||||
function.isHeader = Flags.IS_HEADER_FUNCTION.get(flags)
|
||||
function.isExpect = Flags.IS_HEADER_FUNCTION.get(flags)
|
||||
return function
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ class DeserializedClassDescriptor(
|
||||
|
||||
override fun isData() = Flags.IS_DATA.get(classProto.flags)
|
||||
|
||||
override fun isHeader() = Flags.IS_HEADER_CLASS.get(classProto.flags)
|
||||
override fun isExpect() = Flags.IS_HEADER_CLASS.get(classProto.flags)
|
||||
|
||||
override fun isImpl() = false
|
||||
|
||||
|
||||
+3
-5
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.serialization.deserialization.descriptors
|
||||
|
||||
import org.jetbrains.annotations.NotNull
|
||||
import org.jetbrains.annotations.Nullable
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.descriptors.impl.*
|
||||
@@ -106,7 +104,7 @@ class DeserializedPropertyDescriptor(
|
||||
isConst: Boolean,
|
||||
isExternal: Boolean,
|
||||
isDelegated: Boolean,
|
||||
isHeader: Boolean,
|
||||
isExpect: Boolean,
|
||||
override val proto: ProtoBuf.Property,
|
||||
override val nameResolver: NameResolver,
|
||||
override val typeTable: TypeTable,
|
||||
@@ -114,7 +112,7 @@ class DeserializedPropertyDescriptor(
|
||||
override val containerSource: DeserializedContainerSource?
|
||||
) : DeserializedCallableMemberDescriptor, PropertyDescriptorImpl(
|
||||
containingDeclaration, original, annotations, modality, visibility, isVar, name, kind, SourceElement.NO_SOURCE,
|
||||
isLateInit, isConst, isHeader, false, isExternal, isDelegated
|
||||
isLateInit, isConst, isExpect, false, isExternal, isDelegated
|
||||
) {
|
||||
override fun createSubstitutedCopy(
|
||||
newOwner: DeclarationDescriptor,
|
||||
@@ -126,7 +124,7 @@ class DeserializedPropertyDescriptor(
|
||||
): PropertyDescriptorImpl {
|
||||
return DeserializedPropertyDescriptor(
|
||||
newOwner, original, annotations, newModality, newVisibility, isVar, newName, kind, isLateInit, isConst, isExternal,
|
||||
@Suppress("DEPRECATION") isDelegated, isHeader, proto, nameResolver, typeTable, sinceKotlinInfoTable, containerSource
|
||||
@Suppress("DEPRECATION") isDelegated, isExpect, proto, nameResolver, typeTable, sinceKotlinInfoTable, containerSource
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user