FIC: Introduce isFun property for descriptors and proto
This commit is contained in:
@@ -10100,6 +10100,7 @@ public final class DebugProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
boolean hasFlags();
|
||||
@@ -10116,6 +10117,7 @@ public final class DebugProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
int getFlags();
|
||||
@@ -10853,6 +10855,7 @@ public final class DebugProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasFlags() {
|
||||
@@ -10871,6 +10874,7 @@ public final class DebugProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public int getFlags() {
|
||||
@@ -12242,6 +12246,7 @@ public final class DebugProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasFlags() {
|
||||
@@ -12260,6 +12265,7 @@ public final class DebugProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public int getFlags() {
|
||||
@@ -12278,6 +12284,7 @@ public final class DebugProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public Builder setFlags(int value) {
|
||||
@@ -12299,6 +12306,7 @@ public final class DebugProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public Builder clearFlags() {
|
||||
|
||||
+4
-2
@@ -168,7 +168,8 @@ class Fir2IrDeclarationStorage(
|
||||
isData = regularClass?.isData == true,
|
||||
isExternal = regularClass?.isExternal == true,
|
||||
isInline = regularClass?.isInline == true,
|
||||
isExpect = regularClass?.isExpect == true
|
||||
isExpect = regularClass?.isExpect == true,
|
||||
isFun = false // TODO
|
||||
).apply {
|
||||
descriptor.bind(this)
|
||||
if (setParent && regularClass != null) {
|
||||
@@ -215,7 +216,8 @@ class Fir2IrDeclarationStorage(
|
||||
startOffset, endOffset, origin, symbol,
|
||||
Name.special("<no name provided>"), anonymousObject.classKind,
|
||||
Visibilities.LOCAL, modality,
|
||||
isCompanion = false, isInner = false, isData = false, isExternal = false, isInline = false, isExpect = false
|
||||
isCompanion = false, isInner = false, isData = false, isExternal = false,
|
||||
isInline = false, isExpect = false, isFun = false
|
||||
).apply {
|
||||
descriptor.bind(this)
|
||||
declareThisReceiver()
|
||||
|
||||
+1
@@ -82,6 +82,7 @@ class SyntheticClassOrObjectDescriptor(
|
||||
override fun isInline() = false
|
||||
override fun isExpect() = false
|
||||
override fun isActual() = false
|
||||
override fun isFun() = false
|
||||
|
||||
override fun getCompanionObjectDescriptor(): ClassDescriptorWithResolutionScopes? = null
|
||||
override fun getTypeConstructor(): TypeConstructor = typeConstructor
|
||||
|
||||
+8
@@ -86,6 +86,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
||||
private final boolean isInline;
|
||||
private final boolean isExpect;
|
||||
private final boolean isActual;
|
||||
private final boolean isFun;
|
||||
|
||||
private final Annotations annotations;
|
||||
private final Annotations danglingAnnotations;
|
||||
@@ -158,6 +159,8 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
||||
this.isExpect = modifierList != null && PsiUtilsKt.hasExpectModifier(modifierList) ||
|
||||
containingDeclaration instanceof ClassDescriptor && ((ClassDescriptor) containingDeclaration).isExpect();
|
||||
|
||||
this.isFun = modifierList != null && PsiUtilsKt.hasFunModifier(modifierList);
|
||||
|
||||
// Annotation entries are taken from both own annotations (if any) and object literal annotations (if any)
|
||||
List<KtAnnotationEntry> annotationEntries = new ArrayList<>();
|
||||
if (classOrObject != null && classOrObject.getParent() instanceof KtObjectLiteralExpression) {
|
||||
@@ -533,6 +536,11 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
||||
return isActual;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFun() {
|
||||
return isFun;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Annotations getAnnotations() {
|
||||
|
||||
+2
-1
@@ -294,7 +294,8 @@ abstract class AbstractSuspendFunctionsLowering<C : CommonBackendContext>(val co
|
||||
isData = false,
|
||||
isExternal = false,
|
||||
isInline = false,
|
||||
isExpect = false
|
||||
isExpect = false,
|
||||
isFun = false
|
||||
).apply {
|
||||
d.bind(this)
|
||||
parent = irFunction.parent
|
||||
|
||||
+2
-1
@@ -26,7 +26,8 @@ fun IrClassBuilder.buildClass(): IrClass {
|
||||
startOffset, endOffset, origin,
|
||||
IrClassSymbolImpl(wrappedDescriptor),
|
||||
name, kind, visibility, modality,
|
||||
isCompanion = isCompanion, isInner = isInner, isData = isData, isExternal = isExternal, isInline = isInline, isExpect = isExpect
|
||||
isCompanion = isCompanion, isInner = isInner, isData = isData, isExternal = isExternal,
|
||||
isInline = isInline, isExpect = isExpect, isFun = isFun
|
||||
).also {
|
||||
wrappedDescriptor.bind(it)
|
||||
}
|
||||
|
||||
+2
-1
@@ -126,7 +126,8 @@ class JsSharedVariablesManager(val builtIns: IrBuiltIns, val implicitDeclaration
|
||||
val declaration = IrClassImpl(
|
||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, JsLoweredDeclarationOrigin.JS_CLOSURE_BOX_CLASS_DECLARATION, IrClassSymbolImpl(descriptor),
|
||||
Name.identifier(boxTypeName), ClassKind.CLASS, Visibilities.PUBLIC, Modality.FINAL,
|
||||
isCompanion = false, isInner = false, isData = false, isExternal = false, isInline = false, isExpect = false
|
||||
isCompanion = false, isInner = false, isData = false, isExternal = false,
|
||||
isInline = false, isExpect = false, isFun = false
|
||||
)
|
||||
|
||||
descriptor.bind(declaration)
|
||||
|
||||
+2
-1
@@ -236,7 +236,8 @@ class JvmDeclarationFactory(
|
||||
isData = false,
|
||||
isExternal = false,
|
||||
isInline = false,
|
||||
isExpect = false
|
||||
isExpect = false,
|
||||
isFun = false
|
||||
).apply {
|
||||
descriptor.bind(this)
|
||||
parent = interfaceClass
|
||||
|
||||
+2
-1
@@ -88,7 +88,8 @@ private class FileClassLowering(val context: JvmBackendContext) : FileLoweringPa
|
||||
isData = false,
|
||||
isExternal = false,
|
||||
isInline = false,
|
||||
isExpect = false
|
||||
isExpect = false,
|
||||
isFun = false
|
||||
).apply {
|
||||
descriptor.bind(this)
|
||||
superTypes.add(context.irBuiltIns.anyType)
|
||||
|
||||
+2
@@ -19,6 +19,7 @@ class IrClassBuilder : IrDeclarationBuilder() {
|
||||
var isExternal: Boolean = false
|
||||
var isInline: Boolean = false
|
||||
var isExpect: Boolean = false
|
||||
var isFun: Boolean = false
|
||||
|
||||
fun updateFrom(from: IrClass) {
|
||||
super.updateFrom(from)
|
||||
@@ -31,5 +32,6 @@ class IrClassBuilder : IrDeclarationBuilder() {
|
||||
isExternal = from.isExternal
|
||||
isInline = from.isInline
|
||||
isExpect = from.isExpect
|
||||
isFun = from.isFun
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ interface IrClass :
|
||||
val isExternal: Boolean
|
||||
val isInline: Boolean
|
||||
val isExpect: Boolean
|
||||
val isFun: Boolean
|
||||
|
||||
val superTypes: MutableList<IrType>
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ class IrClassImpl(
|
||||
override val isData: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val isInline: Boolean,
|
||||
override val isExpect: Boolean
|
||||
override val isExpect: Boolean,
|
||||
override val isFun: Boolean
|
||||
) :
|
||||
IrDeclarationBase(startOffset, endOffset, origin),
|
||||
IrClass {
|
||||
@@ -66,7 +67,8 @@ class IrClassImpl(
|
||||
isData = symbol.descriptor.isData,
|
||||
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
||||
isInline = symbol.descriptor.isInline,
|
||||
isExpect = symbol.descriptor.isExpect
|
||||
isExpect = symbol.descriptor.isExpect,
|
||||
isFun = symbol.descriptor.isFun
|
||||
)
|
||||
|
||||
init {
|
||||
|
||||
@@ -35,6 +35,7 @@ class IrLazyClass(
|
||||
override val isExternal: Boolean,
|
||||
override val isInline: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
override val isFun: Boolean,
|
||||
stubGenerator: DeclarationStubGenerator,
|
||||
typeTranslator: TypeTranslator
|
||||
) :
|
||||
@@ -59,6 +60,7 @@ class IrLazyClass(
|
||||
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
||||
isInline = symbol.descriptor.isInline,
|
||||
isExpect = symbol.descriptor.isExpect,
|
||||
isFun = symbol.descriptor.isFun,
|
||||
stubGenerator = stubGenerator,
|
||||
typeTranslator = TypeTranslator
|
||||
)
|
||||
|
||||
@@ -595,6 +595,8 @@ open class WrappedClassDescriptor(
|
||||
|
||||
override fun isInline() = owner.isInline
|
||||
|
||||
override fun isFun() = owner.isFun
|
||||
|
||||
override fun getThisAsReceiverParameter() = owner.thisReceiver?.descriptor as ReceiverParameterDescriptor
|
||||
|
||||
override fun getUnsubstitutedPrimaryConstructor() =
|
||||
@@ -705,6 +707,8 @@ open class WrappedEnumEntryDescriptor(
|
||||
|
||||
override fun isInline() = false
|
||||
|
||||
override fun isFun() = false
|
||||
|
||||
override fun getThisAsReceiverParameter() = (owner.parent as IrClass).descriptor.thisAsReceiverParameter
|
||||
|
||||
override fun getUnsubstitutedPrimaryConstructor(): ClassConstructorDescriptor? {
|
||||
|
||||
@@ -147,7 +147,8 @@ open class DeepCopyIrTreeWithSymbols(
|
||||
declaration.isData,
|
||||
declaration.isExternal,
|
||||
declaration.isInline,
|
||||
declaration.isExpect
|
||||
declaration.isExpect,
|
||||
declaration.isFun
|
||||
).apply {
|
||||
transformAnnotations(declaration)
|
||||
copyTypeParametersFrom(declaration)
|
||||
|
||||
@@ -648,6 +648,7 @@ message IrClass {
|
||||
required IrDeclarationContainer declaration_container = 13;
|
||||
repeated int32 super_type = 14;
|
||||
required bool is_expect = 15;
|
||||
required bool is_fun = 16;
|
||||
}
|
||||
|
||||
message IrTypeAlias {
|
||||
|
||||
+2
-1
@@ -980,7 +980,8 @@ abstract class IrFileDeserializer(
|
||||
isData = proto.isData,
|
||||
isExternal = proto.isExternal,
|
||||
isInline = proto.isInline,
|
||||
isExpect = proto.isExpect
|
||||
isExpect = proto.isExpect,
|
||||
isFun = proto.isFun
|
||||
)
|
||||
}.usingParent {
|
||||
proto.declarationContainer.declarationList.mapTo(declarations) { deserializeDeclaration(it) }
|
||||
|
||||
+77
@@ -198,6 +198,11 @@ public final class IrClass extends
|
||||
isExpect_ = input.readBool();
|
||||
break;
|
||||
}
|
||||
case 128: {
|
||||
bitField0_ |= 0x00004000;
|
||||
isFun_ = input.readBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
@@ -475,6 +480,21 @@ public final class IrClass extends
|
||||
return isExpect_;
|
||||
}
|
||||
|
||||
public static final int IS_FUN_FIELD_NUMBER = 16;
|
||||
private boolean isFun_;
|
||||
/**
|
||||
* <code>required bool is_fun = 16;</code>
|
||||
*/
|
||||
public boolean hasIsFun() {
|
||||
return ((bitField0_ & 0x00004000) == 0x00004000);
|
||||
}
|
||||
/**
|
||||
* <code>required bool is_fun = 16;</code>
|
||||
*/
|
||||
public boolean getIsFun() {
|
||||
return isFun_;
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
|
||||
name_ = 0;
|
||||
@@ -491,6 +511,7 @@ public final class IrClass extends
|
||||
declarationContainer_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationContainer.getDefaultInstance();
|
||||
superType_ = java.util.Collections.emptyList();
|
||||
isExpect_ = false;
|
||||
isFun_ = false;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
@@ -550,6 +571,10 @@ public final class IrClass extends
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasIsFun()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getBase().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
@@ -624,6 +649,9 @@ public final class IrClass extends
|
||||
if (((bitField0_ & 0x00002000) == 0x00002000)) {
|
||||
output.writeBool(15, isExpect_);
|
||||
}
|
||||
if (((bitField0_ & 0x00004000) == 0x00004000)) {
|
||||
output.writeBool(16, isFun_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
@@ -698,6 +726,10 @@ public final class IrClass extends
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeBoolSize(15, isExpect_);
|
||||
}
|
||||
if (((bitField0_ & 0x00004000) == 0x00004000)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeBoolSize(16, isFun_);
|
||||
}
|
||||
size += unknownFields.size();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
@@ -822,6 +854,8 @@ public final class IrClass extends
|
||||
bitField0_ = (bitField0_ & ~0x00002000);
|
||||
isExpect_ = false;
|
||||
bitField0_ = (bitField0_ & ~0x00004000);
|
||||
isFun_ = false;
|
||||
bitField0_ = (bitField0_ & ~0x00008000);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -906,6 +940,10 @@ public final class IrClass extends
|
||||
to_bitField0_ |= 0x00002000;
|
||||
}
|
||||
result.isExpect_ = isExpect_;
|
||||
if (((from_bitField0_ & 0x00008000) == 0x00008000)) {
|
||||
to_bitField0_ |= 0x00004000;
|
||||
}
|
||||
result.isFun_ = isFun_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
return result;
|
||||
}
|
||||
@@ -964,6 +1002,9 @@ public final class IrClass extends
|
||||
if (other.hasIsExpect()) {
|
||||
setIsExpect(other.getIsExpect());
|
||||
}
|
||||
if (other.hasIsFun()) {
|
||||
setIsFun(other.getIsFun());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
@@ -1022,6 +1063,10 @@ public final class IrClass extends
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasIsFun()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getBase().isInitialized()) {
|
||||
|
||||
return false;
|
||||
@@ -1742,6 +1787,38 @@ public final class IrClass extends
|
||||
return this;
|
||||
}
|
||||
|
||||
private boolean isFun_ ;
|
||||
/**
|
||||
* <code>required bool is_fun = 16;</code>
|
||||
*/
|
||||
public boolean hasIsFun() {
|
||||
return ((bitField0_ & 0x00008000) == 0x00008000);
|
||||
}
|
||||
/**
|
||||
* <code>required bool is_fun = 16;</code>
|
||||
*/
|
||||
public boolean getIsFun() {
|
||||
return isFun_;
|
||||
}
|
||||
/**
|
||||
* <code>required bool is_fun = 16;</code>
|
||||
*/
|
||||
public Builder setIsFun(boolean value) {
|
||||
bitField0_ |= 0x00008000;
|
||||
isFun_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required bool is_fun = 16;</code>
|
||||
*/
|
||||
public Builder clearIsFun() {
|
||||
bitField0_ = (bitField0_ & ~0x00008000);
|
||||
isFun_ = false;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrClass)
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -153,4 +153,13 @@ public interface IrClassOrBuilder extends
|
||||
* <code>required bool is_expect = 15;</code>
|
||||
*/
|
||||
boolean getIsExpect();
|
||||
|
||||
/**
|
||||
* <code>required bool is_fun = 16;</code>
|
||||
*/
|
||||
boolean hasIsFun();
|
||||
/**
|
||||
* <code>required bool is_fun = 16;</code>
|
||||
*/
|
||||
boolean getIsFun();
|
||||
}
|
||||
@@ -445,6 +445,8 @@ fun KtModifierListOwner.hasActualModifier() = hasModifier(KtTokens.IMPL_KEYWORD)
|
||||
fun KtModifierList.hasActualModifier() = hasModifier(KtTokens.IMPL_KEYWORD) || hasModifier(KtTokens.ACTUAL_KEYWORD)
|
||||
fun KtModifierList.hasSuspendModifier() = hasModifier(KtTokens.SUSPEND_KEYWORD)
|
||||
|
||||
fun KtModifierList.hasFunModifier() = hasModifier(KtTokens.FUN_KEYWORD)
|
||||
|
||||
fun ASTNode.children() = generateSequence(firstChildNode) { node -> node.treeNext }
|
||||
fun ASTNode.parents() = generateSequence(treeParent) { node -> node.treeParent }
|
||||
|
||||
|
||||
+2
-1
@@ -69,7 +69,8 @@ class DescriptorSerializer private constructor(
|
||||
ProtoEnumFlags.visibility(normalizeVisibility(classDescriptor)),
|
||||
ProtoEnumFlags.modality(classDescriptor.modality),
|
||||
ProtoEnumFlags.classKind(classDescriptor.kind, classDescriptor.isCompanionObject),
|
||||
classDescriptor.isInner, classDescriptor.isData, classDescriptor.isExternal, classDescriptor.isExpect, classDescriptor.isInline
|
||||
classDescriptor.isInner, classDescriptor.isData, classDescriptor.isExternal, classDescriptor.isExpect,
|
||||
classDescriptor.isInline, classDescriptor.isFun
|
||||
)
|
||||
if (flags != builder.flags) {
|
||||
builder.flags = flags
|
||||
|
||||
+1
@@ -97,6 +97,7 @@ class LazyJavaClassDescriptor(
|
||||
override fun isCompanionObject() = false
|
||||
override fun isExpect() = false
|
||||
override fun isActual() = false
|
||||
override fun isFun() = false
|
||||
|
||||
private val typeConstructor = LazyJavaClassTypeConstructor()
|
||||
override fun getTypeConstructor(): TypeConstructor = typeConstructor
|
||||
|
||||
+1
@@ -95,6 +95,7 @@ class FunctionClassDescriptor(
|
||||
override fun isInner() = false
|
||||
override fun isData() = false
|
||||
override fun isInline() = false
|
||||
override fun isFun() = false
|
||||
override fun isExpect() = false
|
||||
override fun isActual() = false
|
||||
override fun isExternal() = false
|
||||
|
||||
@@ -70,6 +70,8 @@ public interface ClassDescriptor extends ClassifierDescriptorWithTypeParameters,
|
||||
|
||||
boolean isInline();
|
||||
|
||||
boolean isFun();
|
||||
|
||||
@NotNull
|
||||
ReceiverParameterDescriptor getThisAsReceiverParameter();
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo
|
||||
override fun isCompanionObject() = false
|
||||
override fun isData() = false
|
||||
override fun isInline() = false
|
||||
override fun isFun() = false
|
||||
override fun isExpect() = false
|
||||
override fun isActual() = false
|
||||
override fun isExternal() = false
|
||||
|
||||
@@ -144,6 +144,11 @@ public class ClassDescriptorImpl extends ClassDescriptorBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFun() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInner() {
|
||||
return false;
|
||||
|
||||
+5
@@ -138,6 +138,11 @@ public class EnumEntrySyntheticClassDescriptor extends ClassDescriptorBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFun() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompanionObject() {
|
||||
return false;
|
||||
|
||||
+5
@@ -243,6 +243,11 @@ public class LazySubstitutingClassDescriptor extends ModuleAwareClassDescriptor
|
||||
return original.isInline();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFun() {
|
||||
return original.isFun();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExternal() {
|
||||
return original.isExternal();
|
||||
|
||||
@@ -99,6 +99,11 @@ public class MutableClassDescriptor extends ClassDescriptorBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFun() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompanionObject() {
|
||||
return false;
|
||||
|
||||
+2
@@ -104,6 +104,8 @@ class DeserializedClassDescriptor(
|
||||
|
||||
override fun isExternal() = Flags.IS_EXTERNAL_CLASS.get(classProto.flags)
|
||||
|
||||
override fun isFun() = Flags.IS_FUN_INTERFACE.get(classProto.flags)
|
||||
|
||||
override fun getUnsubstitutedMemberScope(kotlinTypeRefiner: KotlinTypeRefiner): MemberScope =
|
||||
memberScopeHolder.getScope(kotlinTypeRefiner)
|
||||
|
||||
|
||||
@@ -209,6 +209,7 @@ message Class {
|
||||
isExternal
|
||||
isExpect
|
||||
isInline
|
||||
isFun
|
||||
*/
|
||||
optional int32 flags = 1 [default = 6 /* public final class, no annotations */];
|
||||
|
||||
|
||||
@@ -8273,6 +8273,7 @@ public final class ProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
boolean hasFlags();
|
||||
@@ -8289,6 +8290,7 @@ public final class ProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
int getFlags();
|
||||
@@ -8914,6 +8916,7 @@ public final class ProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasFlags() {
|
||||
@@ -8932,6 +8935,7 @@ public final class ProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public int getFlags() {
|
||||
@@ -10059,6 +10063,7 @@ public final class ProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasFlags() {
|
||||
@@ -10077,6 +10082,7 @@ public final class ProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public int getFlags() {
|
||||
@@ -10095,6 +10101,7 @@ public final class ProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public Builder setFlags(int value) {
|
||||
@@ -10116,6 +10123,7 @@ public final class ProtoBuf {
|
||||
*isExternal
|
||||
*isExpect
|
||||
*isInline
|
||||
*isFun
|
||||
* </pre>
|
||||
*/
|
||||
public Builder clearFlags() {
|
||||
|
||||
@@ -30,6 +30,7 @@ public class Flags {
|
||||
public static final BooleanFlagField IS_EXTERNAL_CLASS = FlagField.booleanAfter(IS_DATA);
|
||||
public static final BooleanFlagField IS_EXPECT_CLASS = FlagField.booleanAfter(IS_EXTERNAL_CLASS);
|
||||
public static final BooleanFlagField IS_INLINE_CLASS = FlagField.booleanAfter(IS_EXPECT_CLASS);
|
||||
public static final BooleanFlagField IS_FUN_INTERFACE = FlagField.booleanAfter(IS_INLINE_CLASS);
|
||||
|
||||
// Constructors
|
||||
|
||||
@@ -95,7 +96,8 @@ public class Flags {
|
||||
boolean isData,
|
||||
boolean isExternal,
|
||||
boolean isExpect,
|
||||
boolean isInline
|
||||
boolean isInline,
|
||||
boolean isFun
|
||||
) {
|
||||
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
||||
| MODALITY.toFlags(modality)
|
||||
@@ -106,6 +108,7 @@ public class Flags {
|
||||
| IS_EXTERNAL_CLASS.toFlags(isExternal)
|
||||
| IS_EXPECT_CLASS.toFlags(isExpect)
|
||||
| IS_INLINE_CLASS.toFlags(isInline)
|
||||
| IS_FUN_INTERFACE.toFlags(isFun)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -78,6 +78,7 @@ class CommonizedClassDescriptor(
|
||||
override fun isInner() = isInner
|
||||
override fun isExpect() = isExpect
|
||||
override fun isActual() = isActual
|
||||
override fun isFun() = false // TODO: modifier "fun" should be accessible from here too
|
||||
|
||||
override fun getUnsubstitutedMemberScope(kotlinTypeRefiner: KotlinTypeRefiner): CommonizedMemberScope {
|
||||
check(kotlinTypeRefiner == KotlinTypeRefiner.Default) {
|
||||
|
||||
Reference in New Issue
Block a user