Get rid of name in FirConstructor
This commit is contained in:
-2
@@ -10,7 +10,6 @@ import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.fir.visitors.*
|
||||
|
||||
@@ -27,7 +26,6 @@ interface FirCallableMemberDeclaration<F : FirCallableMemberDeclaration<F>> : Fi
|
||||
override val returnTypeRef: FirTypeRef
|
||||
override val receiverTypeRef: FirTypeRef?
|
||||
override val symbol: FirCallableSymbol<F>
|
||||
override val name: Name
|
||||
override val typeParameters: List<FirTypeParameter>
|
||||
override val status: FirDeclarationStatus
|
||||
val containerSource: DeserializedContainerSource?
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.fir.expressions.FirDelegatedConstructorCall
|
||||
import org.jetbrains.kotlin.fir.references.FirControlFlowGraphReference
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirConstructorSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.fir.visitors.*
|
||||
|
||||
@@ -31,7 +30,6 @@ interface FirConstructor : FirFunction<FirConstructor>, FirCallableMemberDeclara
|
||||
override val controlFlowGraphReference: FirControlFlowGraphReference
|
||||
override val typeParameters: List<FirTypeParameter>
|
||||
override val valueParameters: List<FirValueParameter>
|
||||
override val name: Name
|
||||
override val status: FirDeclarationStatus
|
||||
override val containerSource: DeserializedContainerSource?
|
||||
override val annotations: List<FirAnnotationCall>
|
||||
|
||||
@@ -9,7 +9,6 @@ import org.jetbrains.kotlin.fir.FirAnnotationContainer
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.fir.visitors.*
|
||||
|
||||
/*
|
||||
@@ -22,7 +21,6 @@ interface FirMemberDeclaration : FirDeclaration, FirAnnotationContainer {
|
||||
override val session: FirSession
|
||||
override val resolvePhase: FirResolvePhase
|
||||
override val annotations: List<FirAnnotationCall>
|
||||
val name: Name
|
||||
val typeParameters: List<FirTypeParameter>
|
||||
val status: FirDeclarationStatus
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ interface FirRegularClass : FirMemberDeclaration, FirTypeParametersOwner, FirCla
|
||||
override val session: FirSession
|
||||
override val resolvePhase: FirResolvePhase
|
||||
override val annotations: List<FirAnnotationCall>
|
||||
override val name: Name
|
||||
override val typeParameters: List<FirTypeParameter>
|
||||
override val status: FirDeclarationStatus
|
||||
override val classKind: ClassKind
|
||||
override val declarations: List<FirDeclaration>
|
||||
override val scopeProvider: FirScopeProvider
|
||||
val name: Name
|
||||
override val symbol: FirRegularClassSymbol
|
||||
val companionObject: FirRegularClass?
|
||||
override val superTypeRefs: List<FirTypeRef>
|
||||
|
||||
@@ -27,12 +27,12 @@ abstract class FirSealedClass : FirPureAbstractElement(), FirRegularClass {
|
||||
abstract override val session: FirSession
|
||||
abstract override val resolvePhase: FirResolvePhase
|
||||
abstract override val annotations: List<FirAnnotationCall>
|
||||
abstract override val name: Name
|
||||
abstract override val typeParameters: List<FirTypeParameter>
|
||||
abstract override val status: FirDeclarationStatus
|
||||
abstract override val classKind: ClassKind
|
||||
abstract override val declarations: List<FirDeclaration>
|
||||
abstract override val scopeProvider: FirScopeProvider
|
||||
abstract override val name: Name
|
||||
abstract override val symbol: FirRegularClassSymbol
|
||||
abstract override val companionObject: FirRegularClass?
|
||||
abstract override val superTypeRefs: List<FirTypeRef>
|
||||
|
||||
@@ -33,10 +33,10 @@ abstract class FirSimpleFunction : FirPureAbstractElement(), FirFunction<FirSimp
|
||||
abstract override val typeParameters: List<FirTypeParameter>
|
||||
abstract override val valueParameters: List<FirValueParameter>
|
||||
abstract override val body: FirBlock?
|
||||
abstract override val name: Name
|
||||
abstract override val status: FirDeclarationStatus
|
||||
abstract override val containerSource: DeserializedContainerSource?
|
||||
abstract override val contractDescription: FirContractDescription
|
||||
abstract val name: Name
|
||||
abstract override val symbol: FirFunctionSymbol<FirSimpleFunction>
|
||||
abstract override val annotations: List<FirAnnotationCall>
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ abstract class FirTypeAlias : FirPureAbstractElement(), FirClassLikeDeclaration<
|
||||
abstract override val source: FirSourceElement?
|
||||
abstract override val session: FirSession
|
||||
abstract override val resolvePhase: FirResolvePhase
|
||||
abstract override val name: Name
|
||||
abstract override val typeParameters: List<FirTypeParameter>
|
||||
abstract override val status: FirDeclarationStatus
|
||||
abstract val name: Name
|
||||
abstract override val symbol: FirTypeAliasSymbol
|
||||
abstract val expandedTypeRef: FirTypeRef
|
||||
abstract override val annotations: List<FirAnnotationCall>
|
||||
|
||||
@@ -30,10 +30,10 @@ import org.jetbrains.kotlin.fir.visitors.*
|
||||
class FirClassImpl(
|
||||
override val source: FirSourceElement?,
|
||||
override val session: FirSession,
|
||||
override val name: Name,
|
||||
override var status: FirDeclarationStatus,
|
||||
override val classKind: ClassKind,
|
||||
override val scopeProvider: FirScopeProvider,
|
||||
override val name: Name,
|
||||
override val symbol: FirRegularClassSymbol
|
||||
) : FirPureAbstractElement(), FirRegularClass, FirModifiableRegularClass, FirAbstractAnnotatedElement {
|
||||
override var resolvePhase: FirResolvePhase = FirResolvePhase.RAW_FIR
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.jetbrains.kotlin.fir.references.FirControlFlowGraphReference
|
||||
import org.jetbrains.kotlin.fir.references.impl.FirEmptyControlFlowGraphReference
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirConstructorSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.fir.visitors.*
|
||||
|
||||
@@ -41,7 +40,6 @@ open class FirConstructorImpl(
|
||||
override var controlFlowGraphReference: FirControlFlowGraphReference = FirEmptyControlFlowGraphReference()
|
||||
override val typeParameters: MutableList<FirTypeParameter> = mutableListOf()
|
||||
override val valueParameters: MutableList<FirValueParameter> = mutableListOf()
|
||||
override val name: Name = Name.special("<init>")
|
||||
override var containerSource: DeserializedContainerSource? = null
|
||||
override val annotations: MutableList<FirAnnotationCall> = mutableListOf()
|
||||
override var delegatedConstructor: FirDelegatedConstructorCall? = null
|
||||
|
||||
-2
@@ -21,7 +21,6 @@ import org.jetbrains.kotlin.fir.references.FirControlFlowGraphReference
|
||||
import org.jetbrains.kotlin.fir.references.impl.FirEmptyControlFlowGraphReference
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirConstructorSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.fir.visitors.*
|
||||
|
||||
@@ -39,7 +38,6 @@ abstract class FirModifiableConstructor : FirPureAbstractElement(), FirConstruct
|
||||
abstract override var controlFlowGraphReference: FirControlFlowGraphReference
|
||||
abstract override val typeParameters: MutableList<FirTypeParameter>
|
||||
abstract override val valueParameters: MutableList<FirValueParameter>
|
||||
abstract override val name: Name
|
||||
abstract override var status: FirDeclarationStatus
|
||||
abstract override var containerSource: DeserializedContainerSource?
|
||||
abstract override val annotations: MutableList<FirAnnotationCall>
|
||||
|
||||
+1
-1
@@ -31,12 +31,12 @@ interface FirModifiableRegularClass : FirRegularClass, FirModifiableClass<FirReg
|
||||
override val session: FirSession
|
||||
override var resolvePhase: FirResolvePhase
|
||||
override val annotations: MutableList<FirAnnotationCall>
|
||||
override val name: Name
|
||||
override val typeParameters: MutableList<FirTypeParameter>
|
||||
override var status: FirDeclarationStatus
|
||||
override val classKind: ClassKind
|
||||
override val declarations: MutableList<FirDeclaration>
|
||||
override val scopeProvider: FirScopeProvider
|
||||
override val name: Name
|
||||
override val symbol: FirRegularClassSymbol
|
||||
override var companionObject: FirRegularClass?
|
||||
override val superTypeRefs: MutableList<FirTypeRef>
|
||||
|
||||
+1
-1
@@ -31,10 +31,10 @@ import org.jetbrains.kotlin.fir.visitors.*
|
||||
class FirSealedClassImpl(
|
||||
override val source: FirSourceElement?,
|
||||
override val session: FirSession,
|
||||
override val name: Name,
|
||||
override var status: FirDeclarationStatus,
|
||||
override val classKind: ClassKind,
|
||||
override val scopeProvider: FirScopeProvider,
|
||||
override val name: Name,
|
||||
override val symbol: FirRegularClassSymbol
|
||||
) : FirSealedClass(), FirModifiableRegularClass, FirAbstractAnnotatedElement {
|
||||
override var resolvePhase: FirResolvePhase = FirResolvePhase.RAW_FIR
|
||||
|
||||
+1
-1
@@ -35,8 +35,8 @@ open class FirSimpleFunctionImpl(
|
||||
override val session: FirSession,
|
||||
override var returnTypeRef: FirTypeRef,
|
||||
override var receiverTypeRef: FirTypeRef?,
|
||||
override val name: Name,
|
||||
override var status: FirDeclarationStatus,
|
||||
override val name: Name,
|
||||
override val symbol: FirFunctionSymbol<FirSimpleFunction>
|
||||
) : FirSimpleFunction(), FirModifiableFunction<FirSimpleFunction>, FirModifiableTypeParametersOwner, FirAbstractAnnotatedElement {
|
||||
override var resolvePhase: FirResolvePhase = FirResolvePhase.RAW_FIR
|
||||
|
||||
+1
-1
@@ -26,8 +26,8 @@ import org.jetbrains.kotlin.fir.visitors.*
|
||||
class FirTypeAliasImpl(
|
||||
override val source: FirSourceElement?,
|
||||
override val session: FirSession,
|
||||
override val name: Name,
|
||||
override var status: FirDeclarationStatus,
|
||||
override val name: Name,
|
||||
override val symbol: FirTypeAliasSymbol,
|
||||
override var expandedTypeRef: FirTypeRef
|
||||
) : FirTypeAlias(), FirModifiableTypeParametersOwner, FirAbstractAnnotatedElement {
|
||||
|
||||
@@ -48,7 +48,7 @@ fun FirModifiableClass<out FirRegularClass>.generateValuesFunction(
|
||||
isNullable = false
|
||||
)
|
||||
),
|
||||
null, ENUM_VALUES, status, symbol
|
||||
null, status, ENUM_VALUES, symbol
|
||||
).apply {
|
||||
resolvePhase = FirResolvePhase.BODY_RESOLVE
|
||||
body = FirEmptyExpressionBlock()
|
||||
@@ -72,7 +72,7 @@ fun FirModifiableClass<out FirRegularClass>.generateValueOfFunction(
|
||||
isNullable = false
|
||||
)
|
||||
),
|
||||
null, ENUM_VALUE_OF, status, symbol
|
||||
null, status, ENUM_VALUE_OF, symbol
|
||||
).apply {
|
||||
resolvePhase = FirResolvePhase.BODY_RESOLVE
|
||||
valueParameters += FirValueParameterImpl(
|
||||
|
||||
@@ -136,7 +136,7 @@ class FirRenderer(builder: StringBuilder) : FirVisitorVoid() {
|
||||
print(".")
|
||||
}
|
||||
when (callableDeclaration) {
|
||||
is FirMemberDeclaration -> print(callableDeclaration.name)
|
||||
is FirSimpleFunction -> print(callableDeclaration.name)
|
||||
is FirVariable<*> -> print(callableDeclaration.name)
|
||||
}
|
||||
|
||||
@@ -241,7 +241,12 @@ class FirRenderer(builder: StringBuilder) : FirVisitorVoid() {
|
||||
|
||||
visitDeclaration(memberDeclaration)
|
||||
if (memberDeclaration !is FirCallableDeclaration<*>) { // Handled by visitCallableDeclaration
|
||||
print(" " + memberDeclaration.name)
|
||||
if (memberDeclaration is FirRegularClass) {
|
||||
print(" " + memberDeclaration.name)
|
||||
}
|
||||
if (memberDeclaration is FirTypeAlias) {
|
||||
print(" " + memberDeclaration.name)
|
||||
}
|
||||
if (memberDeclaration is FirTypeParametersOwner) {
|
||||
memberDeclaration.typeParameters.renderTypeParameters()
|
||||
}
|
||||
|
||||
-1
@@ -35,7 +35,6 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
parents += modifiableConstructor
|
||||
defaultNull("delegatedConstructor")
|
||||
defaultNull("body")
|
||||
default("name", "Name.special(\"<init>\")")
|
||||
|
||||
default("isPrimary") {
|
||||
value = "false"
|
||||
|
||||
+3
-1
@@ -99,7 +99,6 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
}
|
||||
|
||||
memberDeclaration.configure {
|
||||
+name
|
||||
+typeParameters
|
||||
+status.withTransform()
|
||||
}
|
||||
@@ -219,6 +218,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
|
||||
regularClass.configure {
|
||||
parentArg(klass, "F", regularClass)
|
||||
+name
|
||||
+symbol("FirRegularClassSymbol")
|
||||
+field("companionObject", regularClass, nullable = true)
|
||||
+superTypeRefs(withReplace = true)
|
||||
@@ -235,6 +235,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
|
||||
typeAlias.configure {
|
||||
parentArg(classLikeDeclaration, "F", typeAlias)
|
||||
+name
|
||||
+symbol("FirTypeAliasSymbol")
|
||||
+field("expandedTypeRef", typeRef, withReplace = true)
|
||||
+annotations
|
||||
@@ -262,6 +263,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
|
||||
simpleFunction.configure {
|
||||
parentArg(function, "F", simpleFunction)
|
||||
+name
|
||||
+symbol("FirFunctionSymbol<FirSimpleFunction>")
|
||||
+annotations
|
||||
parentArg(callableMemberDeclaration, "F", simpleFunction)
|
||||
|
||||
Reference in New Issue
Block a user