default -> companion: Replace some missed usages of "isDefault"
This commit is contained in:
@@ -97,7 +97,7 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<KotlinObjectSt
|
||||
public boolean isCompanion() {
|
||||
KotlinObjectStub stub = getStub();
|
||||
if (stub != null) {
|
||||
return stub.isDefault();
|
||||
return stub.isCompanion();
|
||||
}
|
||||
return getClassKeyword() != null || hasModifier(JetTokens.COMPANION_KEYWORD);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public trait KotlinClassStub : KotlinClassOrObjectStub<JetClass> {
|
||||
}
|
||||
|
||||
public trait KotlinObjectStub : KotlinClassOrObjectStub<JetObjectDeclaration> {
|
||||
public fun isDefault(): Boolean
|
||||
public fun isCompanion(): Boolean
|
||||
public fun isObjectLiteral(): Boolean
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@ public class JetObjectElementType extends JetStubElementType<KotlinObjectStub, J
|
||||
dataStream.writeName(fqName != null ? fqName.toString() : null);
|
||||
|
||||
dataStream.writeBoolean(stub.isTopLevel());
|
||||
dataStream.writeBoolean(stub.isDefault());
|
||||
dataStream.writeBoolean(stub.isCompanion());
|
||||
dataStream.writeBoolean(stub.isLocal());
|
||||
dataStream.writeBoolean(stub.isObjectLiteral());
|
||||
|
||||
@@ -75,7 +75,7 @@ public class JetObjectElementType extends JetStubElementType<KotlinObjectStub, J
|
||||
FqName fqName = fqNameStr != null ? new FqName(fqNameStr.toString()) : null;
|
||||
|
||||
boolean isTopLevel = dataStream.readBoolean();
|
||||
boolean isDefault = dataStream.readBoolean();
|
||||
boolean isCompanion = dataStream.readBoolean();
|
||||
boolean isLocal = dataStream.readBoolean();
|
||||
boolean isObjectLiteral = dataStream.readBoolean();
|
||||
|
||||
@@ -85,7 +85,7 @@ public class JetObjectElementType extends JetStubElementType<KotlinObjectStub, J
|
||||
superNames[i] = dataStream.readName();
|
||||
}
|
||||
|
||||
return new KotlinObjectStubImpl(parentStub, name, fqName, superNames, isTopLevel, isDefault, isLocal, isObjectLiteral);
|
||||
return new KotlinObjectStubImpl(parentStub, name, fqName, superNames, isTopLevel, isCompanion, isLocal, isObjectLiteral);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ public class KotlinObjectStubImpl(
|
||||
override fun getName() = StringRef.toString(name)
|
||||
override fun getSuperNames() = superNames map { it.toString() }
|
||||
override fun isTopLevel() = isTopLevel
|
||||
override fun isDefault() = isDefault
|
||||
override fun isCompanion() = isDefault
|
||||
override fun isObjectLiteral() = isObjectLiteral
|
||||
override fun isLocal() = isLocal
|
||||
}
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ public class DeserializedClassDescriptor(
|
||||
private val visibility = deserialization.visibility(Flags.VISIBILITY.get(classProto.getFlags()))
|
||||
private val kindFromProto = Flags.CLASS_KIND.get(classProto.getFlags())
|
||||
private val kind = deserialization.classKind(kindFromProto)
|
||||
private val isDefault = kindFromProto == ProtoBuf.Class.Kind.CLASS_OBJECT
|
||||
private val isCompanion = kindFromProto == ProtoBuf.Class.Kind.CLASS_OBJECT
|
||||
private val isInner = Flags.INNER.get(classProto.getFlags())
|
||||
|
||||
val c = outerContext.childContext(this, classProto.getTypeParameterList(), nameResolver)
|
||||
@@ -92,7 +92,7 @@ public class DeserializedClassDescriptor(
|
||||
|
||||
override fun getStaticScope() = staticScope
|
||||
|
||||
override fun isCompanionObject(): Boolean = isDefault
|
||||
override fun isCompanionObject(): Boolean = isCompanion
|
||||
|
||||
private fun computePrimaryConstructor(): ConstructorDescriptor? {
|
||||
if (!classProto.hasPrimaryConstructor()) return null
|
||||
|
||||
@@ -33,7 +33,7 @@ PsiJetFileStubImpl[package=]
|
||||
REFERENCE_EXPRESSION:[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION:[referencedName=Int]
|
||||
CLASS_BODY:
|
||||
OBJECT_DECLARATION:[fqName=Annotations.Companion, isDefault=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=Annotations.Companion, isCompanion=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
MODIFIER_LIST:[private companion]
|
||||
ANNOTATION_ENTRY:[hasValueArguments=false, shortName=b]
|
||||
CONSTRUCTOR_CALLEE:
|
||||
|
||||
@@ -7,7 +7,7 @@ PsiJetFileStubImpl[package=test.class_object]
|
||||
MODIFIER_LIST:[internal final]
|
||||
VALUE_PARAMETER_LIST:
|
||||
CLASS_BODY:
|
||||
OBJECT_DECLARATION:[fqName=test.class_object.ClassObject.Companion, isDefault=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=test.class_object.ClassObject.Companion, isCompanion=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
MODIFIER_LIST:[public companion]
|
||||
CLASS_BODY:
|
||||
PROPERTY:[fqName=test.class_object.ClassObject.Companion.j, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReceiverTypeRef=false, hasReturnTypeRef=true, isProbablyNothingType=false, isTopLevel=false, isVar=false, name=j]
|
||||
@@ -67,21 +67,21 @@ PsiJetFileStubImpl[package=test.class_object]
|
||||
MODIFIER_LIST:[internal final]
|
||||
VALUE_PARAMETER_LIST:
|
||||
CLASS_BODY:
|
||||
OBJECT_DECLARATION:[fqName=test.class_object.ClassObject.B.Companion, isDefault=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=test.class_object.ClassObject.B.Companion, isCompanion=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
MODIFIER_LIST:[internal companion]
|
||||
CLASS_BODY:
|
||||
CLASS:[fqName=test.class_object.ClassObject.B.Companion.C, isEnumEntry=false, isLocal=false, isTopLevel=false, isTrait=false, name=C, superNames=[]]
|
||||
MODIFIER_LIST:[internal final]
|
||||
VALUE_PARAMETER_LIST:
|
||||
CLASS_BODY:
|
||||
OBJECT_DECLARATION:[fqName=test.class_object.ClassObject.B.Companion.C.Companion, isDefault=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=test.class_object.ClassObject.B.Companion.C.Companion, isCompanion=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
MODIFIER_LIST:[internal companion]
|
||||
CLASS_BODY:
|
||||
CLASS:[fqName=test.class_object.ClassObject.B.Companion.C.Companion.D, isEnumEntry=false, isLocal=false, isTopLevel=false, isTrait=false, name=D, superNames=[]]
|
||||
MODIFIER_LIST:[internal final]
|
||||
VALUE_PARAMETER_LIST:
|
||||
CLASS_BODY:
|
||||
OBJECT_DECLARATION:[fqName=test.class_object.ClassObject.B.Companion.C.Companion.D.Companion, isDefault=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=test.class_object.ClassObject.B.Companion.C.Companion.D.Companion, isCompanion=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
MODIFIER_LIST:[internal companion]
|
||||
CLASS_BODY:
|
||||
PROPERTY:[fqName=test.class_object.ClassObject.B.Companion.C.Companion.D.Companion.i, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReceiverTypeRef=false, hasReturnTypeRef=true, isProbablyNothingType=false, isTopLevel=false, isVar=false, name=i]
|
||||
|
||||
@@ -35,7 +35,7 @@ PsiJetFileStubImpl[package=a.b.c.test.enum]
|
||||
REFERENCE_EXPRESSION:[referencedName=enum]
|
||||
REFERENCE_EXPRESSION:[referencedName=Enum]
|
||||
CLASS_BODY:
|
||||
OBJECT_DECLARATION:[fqName=a.b.c.test.enum.Enum.Companion, isDefault=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=a.b.c.test.enum.Enum.Companion, isCompanion=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
MODIFIER_LIST:[internal companion]
|
||||
CLASS_BODY:
|
||||
PROPERTY:[fqName=a.b.c.test.enum.Enum.Companion.c, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReceiverTypeRef=false, hasReturnTypeRef=true, isProbablyNothingType=false, isTopLevel=false, isVar=false, name=c]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
PsiJetFileStubImpl[package=]
|
||||
PACKAGE_DIRECTIVE:
|
||||
OBJECT_DECLARATION:[fqName=Objects, isDefault=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=Objects, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=Objects, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=Objects, superNames=[]]
|
||||
MODIFIER_LIST:[public]
|
||||
CLASS_BODY:
|
||||
PROPERTY:[fqName=Objects.c, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReceiverTypeRef=false, hasReturnTypeRef=true, isProbablyNothingType=false, isTopLevel=false, isVar=false, name=c]
|
||||
@@ -18,7 +18,7 @@ PsiJetFileStubImpl[package=]
|
||||
USER_TYPE:[isAbsoluteInRootPackage=false]
|
||||
REFERENCE_EXPRESSION:[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION:[referencedName=Unit]
|
||||
OBJECT_DECLARATION:[fqName=Objects.InnerObject, isDefault=false, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=InnerObject, superNames=[A]]
|
||||
OBJECT_DECLARATION:[fqName=Objects.InnerObject, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=InnerObject, superNames=[A]]
|
||||
MODIFIER_LIST:[private]
|
||||
DELEGATION_SPECIFIER_LIST:
|
||||
DELEGATOR_SUPER_CLASS:
|
||||
@@ -45,7 +45,7 @@ PsiJetFileStubImpl[package=]
|
||||
MODIFIER_LIST:[open internal]
|
||||
VALUE_PARAMETER_LIST:
|
||||
CLASS_BODY:
|
||||
OBJECT_DECLARATION:[fqName=Objects.OtherObject, isDefault=false, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=OtherObject, superNames=[NestedClass]]
|
||||
OBJECT_DECLARATION:[fqName=Objects.OtherObject, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=OtherObject, superNames=[NestedClass]]
|
||||
MODIFIER_LIST:[public]
|
||||
DELEGATION_SPECIFIER_LIST:
|
||||
DELEGATOR_SUPER_CLASS:
|
||||
|
||||
@@ -3,7 +3,7 @@ PsiJetFileStubImpl[package=]
|
||||
CLASS:[fqName=A, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=A, superNames=[]]
|
||||
CLASS:[fqName=T, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=true, name=T, superNames=[]]
|
||||
PROPERTY:[fqName=obj, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReceiverTypeRef=false, hasReturnTypeRef=false, isProbablyNothingType=false, isTopLevel=true, isVar=false, name=obj]
|
||||
OBJECT_DECLARATION:[fqName=null, isDefault=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[A, T]]
|
||||
OBJECT_DECLARATION:[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[A, T]]
|
||||
DELEGATION_SPECIFIER_LIST:
|
||||
DELEGATOR_SUPER_CALL:
|
||||
CONSTRUCTOR_CALLEE:
|
||||
|
||||
@@ -2,7 +2,7 @@ PsiJetFileStubImpl[package=]
|
||||
PACKAGE_DIRECTIVE:
|
||||
CLASS:[fqName=C, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=C, superNames=[]]
|
||||
CLASS_BODY:
|
||||
OBJECT_DECLARATION:[fqName=C.Companion, isDefault=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=C.Companion, isCompanion=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]]
|
||||
MODIFIER_LIST:[companion]
|
||||
CLASS_BODY:
|
||||
FUN:[fqName=C.Companion.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isProbablyNothingType=false, isTopLevel=false, name=foo]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
PsiJetFileStubImpl[package=]
|
||||
PACKAGE_DIRECTIVE:
|
||||
OBJECT_DECLARATION:[fqName=<no name>, isDefault=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=null, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=<no name>, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=null, superNames=[]]
|
||||
CLASS_BODY:
|
||||
FUN:[fqName=null, hasBlockBody=false, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isProbablyNothingType=false, isTopLevel=false, name=testing]
|
||||
VALUE_PARAMETER_LIST:
|
||||
|
||||
@@ -4,7 +4,7 @@ PsiJetFileStubImpl[package=]
|
||||
CLASS:[fqName=T, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=true, name=T, superNames=[]]
|
||||
FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isProbablyNothingType=false, isTopLevel=true, name=foo]
|
||||
VALUE_PARAMETER_LIST:
|
||||
OBJECT_DECLARATION:[fqName=null, isDefault=false, isLocal=true, isObjectLiteral=false, isTopLevel=false, name=O, superNames=[A, T]]
|
||||
OBJECT_DECLARATION:[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=false, isTopLevel=false, name=O, superNames=[A, T]]
|
||||
DELEGATION_SPECIFIER_LIST:
|
||||
DELEGATOR_SUPER_CALL:
|
||||
CONSTRUCTOR_CALLEE:
|
||||
|
||||
@@ -2,7 +2,7 @@ PsiJetFileStubImpl[package=]
|
||||
PACKAGE_DIRECTIVE:
|
||||
FUN:[fqName=f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isProbablyNothingType=false, isTopLevel=true, name=f]
|
||||
VALUE_PARAMETER_LIST:
|
||||
OBJECT_DECLARATION:[fqName=null, isDefault=false, isLocal=true, isObjectLiteral=false, isTopLevel=false, name=foo, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=false, isTopLevel=false, name=foo, superNames=[]]
|
||||
CLASS_BODY:
|
||||
FUN:[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isProbablyNothingType=false, isTopLevel=false, name=foo]
|
||||
VALUE_PARAMETER_LIST:
|
||||
|
||||
@@ -2,7 +2,7 @@ PsiJetFileStubImpl[package=]
|
||||
PACKAGE_DIRECTIVE:
|
||||
CLASS:[fqName=A, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=A, superNames=[]]
|
||||
CLASS:[fqName=T, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=true, name=T, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=Test, isDefault=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=Test, superNames=[A, T]]
|
||||
OBJECT_DECLARATION:[fqName=Test, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=Test, superNames=[A, T]]
|
||||
DELEGATION_SPECIFIER_LIST:
|
||||
DELEGATOR_SUPER_CALL:
|
||||
CONSTRUCTOR_CALLEE:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
PsiJetFileStubImpl[package=]
|
||||
PACKAGE_DIRECTIVE:
|
||||
PROPERTY:[fqName=p, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReceiverTypeRef=false, hasReturnTypeRef=false, isProbablyNothingType=false, isTopLevel=true, isVar=false, name=p]
|
||||
OBJECT_DECLARATION:[fqName=null, isDefault=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[]]
|
||||
CLASS_BODY:
|
||||
FUN:[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isProbablyNothingType=false, isTopLevel=false, name=f]
|
||||
VALUE_PARAMETER_LIST:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
PsiJetFileStubImpl[package=]
|
||||
PACKAGE_DIRECTIVE:
|
||||
PROPERTY:[fqName=p, hasDelegate=true, hasDelegateExpression=true, hasInitializer=false, hasReceiverTypeRef=false, hasReturnTypeRef=false, isProbablyNothingType=false, isTopLevel=true, isVar=false, name=p]
|
||||
OBJECT_DECLARATION:[fqName=null, isDefault=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[]]
|
||||
OBJECT_DECLARATION:[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[]]
|
||||
CLASS_BODY:
|
||||
FUN:[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isProbablyNothingType=false, isTopLevel=false, name=f]
|
||||
VALUE_PARAMETER_LIST:
|
||||
|
||||
Reference in New Issue
Block a user