[FIR] Fix determination of which type is FIR type in tree generator
^KT-52832 Fixed
This commit is contained in:
committed by
teamcity
parent
a7bae6f4c4
commit
80223bd555
+3
-3
@@ -351,7 +351,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
value = "whenRef.value.subject!!.typeRef"
|
||||
withGetter = true
|
||||
}
|
||||
useTypes(whenExpressionType)
|
||||
useTypes(whenExpression)
|
||||
}
|
||||
|
||||
impl(wrappedDelegateExpression) {
|
||||
@@ -471,11 +471,11 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
impl(simpleFunction)
|
||||
|
||||
impl(safeCallExpression) {
|
||||
useTypes(safeCallCheckedSubjectType)
|
||||
useTypes(checkedSafeCallSubject)
|
||||
}
|
||||
|
||||
impl(checkedSafeCallSubject) {
|
||||
useTypes(expressionType)
|
||||
useTypes(expression)
|
||||
}
|
||||
|
||||
impl(resolvedQualifier) {
|
||||
|
||||
+1
-1
@@ -192,7 +192,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
}
|
||||
|
||||
contextReceiverArgumentListOwner.configure {
|
||||
+fieldList("contextReceiverArguments", expressionType, withReplace = true)
|
||||
+fieldList("contextReceiverArguments", expression, withReplace = true)
|
||||
}
|
||||
|
||||
qualifiedAccess.configure {
|
||||
|
||||
+10
-16
@@ -46,30 +46,24 @@ val operationKindType = type("fir.expressions", "LogicOperationKind")
|
||||
val coneKotlinTypeType = type(ConeKotlinType::class)
|
||||
val coneSimpleKotlinTypeType = type(ConeSimpleKotlinType::class)
|
||||
|
||||
val whenExpressionType = generatedType("expressions", "FirWhenExpression")
|
||||
val expressionType = generatedType("expressions", "FirExpression")
|
||||
val safeCallCheckedSubjectType = generatedType("expressions", "FirCheckedSafeCallSubject")
|
||||
|
||||
val whenRefType = generatedType("", "FirExpressionRef<FirWhenExpression>")
|
||||
val safeCallOriginalReceiverReferenceType = generatedType("", "FirExpressionRef<FirExpression>")
|
||||
val safeCallCheckedSubjectReferenceType = generatedType("", "FirExpressionRef<FirCheckedSafeCallSubject>")
|
||||
|
||||
val firModuleDataType = type("fir", "FirModuleData")
|
||||
val emptyCfgReferenceType = generatedType("references.impl", "FirEmptyControlFlowGraphReference")
|
||||
val noReceiverExpressionType = generatedType("expressions.impl", "FirNoReceiverExpression")
|
||||
val implicitTypeRefType = generatedType("types.impl", "FirImplicitTypeRefImpl")
|
||||
val noReceiverExpressionType = generatedType("expressions.impl", "FirNoReceiverExpression", firType = true)
|
||||
val implicitTypeRefType = generatedType("types.impl", "FirImplicitTypeRefImpl", firType = true)
|
||||
val firQualifierPartType = type("fir.types", "FirQualifierPart")
|
||||
val ConeErrorTypeType = type(ConeErrorType::class)
|
||||
val simpleNamedReferenceType = generatedType("references.impl", "FirSimpleNamedReference")
|
||||
val explicitThisReferenceType = generatedType("references.impl", "FirExplicitThisReference")
|
||||
val explicitSuperReferenceType = generatedType("references.impl", "FirExplicitSuperReference")
|
||||
val implicitBooleanTypeRefType = generatedType("types.impl", "FirImplicitBooleanTypeRef")
|
||||
val implicitNothingTypeRefType = generatedType("types.impl", "FirImplicitNothingTypeRef")
|
||||
val implicitStringTypeRefType = generatedType("types.impl", "FirImplicitStringTypeRef")
|
||||
val implicitUnitTypeRefType = generatedType("types.impl", "FirImplicitUnitTypeRef")
|
||||
val explicitThisReferenceType = generatedType("references.impl", "FirExplicitThisReference", firType = true)
|
||||
val explicitSuperReferenceType = generatedType("references.impl", "FirExplicitSuperReference", firType = true)
|
||||
val implicitBooleanTypeRefType = generatedType("types.impl", "FirImplicitBooleanTypeRef", firType = true)
|
||||
val implicitNothingTypeRefType = generatedType("types.impl", "FirImplicitNothingTypeRef", firType = true)
|
||||
val implicitStringTypeRefType = generatedType("types.impl", "FirImplicitStringTypeRef", firType = true)
|
||||
val implicitUnitTypeRefType = generatedType("types.impl", "FirImplicitUnitTypeRef", firType = true)
|
||||
val resolvePhaseType = type("fir.declarations", "FirResolvePhase")
|
||||
val propertyBodyResolveStateType = type("fir.declarations", "FirPropertyBodyResolveState")
|
||||
val stubReferenceType = generatedType("references.impl", "FirStubReference")
|
||||
val stubReferenceType = generatedType("references.impl", "FirStubReference", firType = true)
|
||||
|
||||
val firBasedSymbolType = type("fir.symbols", "FirBasedSymbol")
|
||||
val backingFieldSymbolType = type("fir.symbols.impl", "FirBackingFieldSymbol")
|
||||
@@ -104,5 +98,5 @@ val deprecationsPerUseSiteType = type("fir.declarations", "DeprecationsPerUseSit
|
||||
val emptyAnnotationArgumentMappingType = type("fir.expressions.impl", "FirEmptyAnnotationArgumentMapping")
|
||||
|
||||
val firPropertySymbolType = type("fir.symbols.impl", "FirPropertySymbol")
|
||||
val errorTypeRefImplType = type("fir.types.impl", "FirErrorTypeRefImpl")
|
||||
val errorTypeRefImplType = type("fir.types.impl", "FirErrorTypeRefImpl", firType = true)
|
||||
|
||||
|
||||
+5
-5
@@ -93,16 +93,16 @@ abstract class AbstractFirTreeBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
fun generatedType(type: String): Type = generatedType("", type)
|
||||
fun generatedType(type: String, firType: Boolean = false): Type = generatedType("", type, firType)
|
||||
|
||||
fun generatedType(packageName: String, type: String): Type {
|
||||
fun generatedType(packageName: String, type: String, firType: Boolean = false): Type {
|
||||
val realPackage = BASE_PACKAGE + if (packageName.isNotBlank()) ".$packageName" else ""
|
||||
return type(realPackage, type, exactPackage = true)
|
||||
return type(realPackage, type, exactPackage = true, firType)
|
||||
}
|
||||
|
||||
fun type(packageName: String?, type: String, exactPackage: Boolean = false): Type {
|
||||
fun type(packageName: String?, type: String, exactPackage: Boolean = false, firType: Boolean = false): Type {
|
||||
val realPackage = if (exactPackage) packageName else packageName?.let { "org.jetbrains.kotlin.$it" }
|
||||
return Type(realPackage, type)
|
||||
return Type(realPackage, type, firType)
|
||||
}
|
||||
|
||||
fun type(type: String): Type = type(null, type)
|
||||
|
||||
+1
-1
@@ -219,5 +219,5 @@ class FieldList(
|
||||
)
|
||||
}
|
||||
|
||||
override val isFirType: Boolean = baseType is AbstractElement
|
||||
override val isFirType: Boolean = baseType is AbstractElement || (baseType is Type && baseType.firType)
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,6 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.tree.generator.model
|
||||
|
||||
data class Type(override val packageName: String?, override val type: String) : Importable {
|
||||
data class Type(override val packageName: String?, override val type: String, val firType: Boolean = false) : Importable {
|
||||
val arguments = mutableListOf<String>()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user