From d86161bccbebad3632d5d1deeadd37f327d5c855 Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Fri, 8 Sep 2023 18:21:07 +0200 Subject: [PATCH] [FIR generator] Remove `Type#firType` property as it has no effect --- .../jetbrains/kotlin/fir/tree/generator/Types.kt | 16 ++++++++-------- .../generator/context/AbstractFirTreeBuilder.kt | 10 +++++----- .../kotlin/fir/tree/generator/model/Field.kt | 2 +- .../kotlin/fir/tree/generator/model/Type.kt | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/Types.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/Types.kt index 0c5c4e88223..910c14f5252 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/Types.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/Types.kt @@ -59,16 +59,16 @@ val firModuleDataType = type("fir", "FirModuleData") val firImplicitTypeWithoutSourceType = generatedType("types.impl", "FirImplicitTypeRefImplWithoutSource") val firQualifierPartType = type("fir.types", "FirQualifierPart") val simpleNamedReferenceType = generatedType("references.impl", "FirSimpleNamedReference") -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 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 resolvePhaseType = type("fir.declarations", "FirResolvePhase") val resolveStateType = type("fir.declarations", "FirResolveState") val propertyBodyResolveStateType = type("fir.declarations", "FirPropertyBodyResolveState") -val stubReferenceType = generatedType("references.impl", "FirStubReference", firType = true) +val stubReferenceType = generatedType("references.impl", "FirStubReference") val firBasedSymbolType = type("fir.symbols", "FirBasedSymbol") val functionSymbolType = type("fir.symbols.impl", "FirFunctionSymbol") @@ -104,6 +104,6 @@ val unresolvedDeprecationsProviderType = type("fir.declarations", "UnresolvedDep val emptyAnnotationArgumentMappingType = type("fir.expressions.impl", "FirEmptyAnnotationArgumentMapping") val firPropertySymbolType = type("fir.symbols.impl", "FirPropertySymbol") -val errorTypeRefImplType = type("fir.types.impl", "FirErrorTypeRefImpl", firType = true) +val errorTypeRefImplType = type("fir.types.impl", "FirErrorTypeRefImpl") val annotationResolvePhaseType = generatedType("expressions", "FirAnnotationResolvePhase") diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/context/AbstractFirTreeBuilder.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/context/AbstractFirTreeBuilder.kt index ccc04d12d3d..1f34ae32ad2 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/context/AbstractFirTreeBuilder.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/context/AbstractFirTreeBuilder.kt @@ -93,16 +93,16 @@ abstract class AbstractFirTreeBuilder { } } -fun generatedType(type: String, firType: Boolean = false): Type = generatedType("", type, firType) +fun generatedType(type: String): Type = generatedType("", type) -fun generatedType(packageName: String, type: String, firType: Boolean = false): Type { +fun generatedType(packageName: String, type: String): Type { val realPackage = BASE_PACKAGE + if (packageName.isNotBlank()) ".$packageName" else "" - return type(realPackage, type, exactPackage = true, firType) + return type(realPackage, type, exactPackage = true) } -fun type(packageName: String?, type: String, exactPackage: Boolean = false, firType: Boolean = false): Type { +fun type(packageName: String?, type: String, exactPackage: Boolean = false): Type { val realPackage = if (exactPackage) packageName else packageName?.let { "org.jetbrains.kotlin.$it" } - return Type(realPackage, type, firType) + return Type(realPackage, type) } fun type(type: String): Type = type(null, type) diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/model/Field.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/model/Field.kt index b87b025c82a..063d2ebcd90 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/model/Field.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/model/Field.kt @@ -257,5 +257,5 @@ class FieldList( ) } - override val isFirType: Boolean = baseType is AbstractElement || (baseType is Type && baseType.firType) + override val isFirType: Boolean = baseType is AbstractElement } diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/model/Type.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/model/Type.kt index e17d8929269..811d2aa17f8 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/model/Type.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/model/Type.kt @@ -8,7 +8,7 @@ package org.jetbrains.kotlin.fir.tree.generator.model import org.jetbrains.kotlin.fir.tree.generator.printer.generics import org.jetbrains.kotlin.generators.tree.Importable -data class Type(override val packageName: String?, override val type: String, val firType: Boolean = false) : Importable { +data class Type(override val packageName: String?, override val type: String) : Importable { val arguments = mutableListOf() override fun getTypeWithArguments(notNull: Boolean): String = type + generics