Use 'symbol' instead of 'classId' in FirResolvedQualifier
This commit solves problem with resolved qualifier of local class #KT-36758 Fixed
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
package org.jetbrains.kotlin.fir.expressions
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeProjection
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
@@ -24,6 +25,7 @@ abstract class FirResolvedQualifier : FirExpression() {
|
||||
abstract val packageFqName: FqName
|
||||
abstract val relativeClassFqName: FqName?
|
||||
abstract val classId: ClassId?
|
||||
abstract val symbol: FirClassLikeSymbol<*>?
|
||||
abstract val safe: Boolean
|
||||
abstract val typeArguments: List<FirTypeProjection>
|
||||
|
||||
|
||||
+3
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
|
||||
import org.jetbrains.kotlin.fir.expressions.builder.FirExpressionBuilder
|
||||
import org.jetbrains.kotlin.fir.expressions.impl.FirResolvedQualifierImpl
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeProjection
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.impl.FirImplicitTypeRefImpl
|
||||
@@ -32,6 +33,7 @@ class FirResolvedQualifierBuilder : FirAnnotationContainerBuilder, FirExpression
|
||||
override val annotations: MutableList<FirAnnotationCall> = mutableListOf()
|
||||
lateinit var packageFqName: FqName
|
||||
var relativeClassFqName: FqName? = null
|
||||
var symbol: FirClassLikeSymbol<*>? = null
|
||||
var safe: Boolean by kotlin.properties.Delegates.notNull<Boolean>()
|
||||
val typeArguments: MutableList<FirTypeProjection> = mutableListOf()
|
||||
|
||||
@@ -42,6 +44,7 @@ class FirResolvedQualifierBuilder : FirAnnotationContainerBuilder, FirExpression
|
||||
annotations,
|
||||
packageFqName,
|
||||
relativeClassFqName,
|
||||
symbol,
|
||||
safe,
|
||||
typeArguments,
|
||||
)
|
||||
|
||||
+2
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.expressions.impl
|
||||
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeProjection
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
@@ -25,6 +26,7 @@ internal class FirResolvedQualifierImpl(
|
||||
override val annotations: MutableList<FirAnnotationCall>,
|
||||
override var packageFqName: FqName,
|
||||
override var relativeClassFqName: FqName?,
|
||||
override val symbol: FirClassLikeSymbol<*>?,
|
||||
override var safe: Boolean,
|
||||
override val typeArguments: MutableList<FirTypeProjection>,
|
||||
) : FirResolvedQualifier() {
|
||||
|
||||
-1
@@ -6,7 +6,6 @@
|
||||
package org.jetbrains.kotlin.fir.tree.generator
|
||||
|
||||
import org.jetbrains.kotlin.fir.tree.generator.context.AbstractBuilderConfigurator
|
||||
import org.jetbrains.kotlin.fir.tree.generator.context.AbstractFirTreeImplementationConfigurator
|
||||
import org.jetbrains.kotlin.fir.tree.generator.model.Element
|
||||
import org.jetbrains.kotlin.fir.tree.generator.model.Field
|
||||
import org.jetbrains.kotlin.fir.tree.generator.model.Implementation
|
||||
|
||||
-2
@@ -6,10 +6,8 @@
|
||||
package org.jetbrains.kotlin.fir.tree.generator
|
||||
|
||||
import org.jetbrains.kotlin.fir.tree.generator.context.AbstractFirTreeImplementationConfigurator
|
||||
import org.jetbrains.kotlin.fir.tree.generator.model.Implementation
|
||||
import org.jetbrains.kotlin.fir.tree.generator.model.Implementation.Kind.Object
|
||||
import org.jetbrains.kotlin.fir.tree.generator.model.Implementation.Kind.OpenClass
|
||||
import org.jetbrains.kotlin.fir.tree.generator.util.traverseParents
|
||||
|
||||
object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator() {
|
||||
fun configureImplementations() {
|
||||
|
||||
+1
@@ -431,6 +431,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
+field("packageFqName", fqNameType)
|
||||
+field("relativeClassFqName", fqNameType, nullable = true)
|
||||
+field("classId", classIdType, nullable = true)
|
||||
+field("symbol", classLikeSymbolType, nullable = true)
|
||||
+booleanField("safe", withReplace = true)
|
||||
+typeArguments.withTransform()
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ val abstractFirBasedSymbolType = type("fir.symbols", "AbstractFirBasedSymbol")
|
||||
val backingFieldSymbolType = type("fir.symbols.impl", "FirBackingFieldSymbol")
|
||||
val delegateFieldSymbolType = type("fir.symbols.impl", "FirDelegateFieldSymbol")
|
||||
val classSymbolType = type("fir.symbols.impl", "FirClassSymbol")
|
||||
val classLikeSymbolType = type("fir.symbols.impl", "FirClassLikeSymbol<*>")
|
||||
val typeParameterSymbolType = type("fir.symbols.impl", "FirTypeParameterSymbol")
|
||||
|
||||
val firScopeProviderType = type("fir.scopes", "FirScopeProvider")
|
||||
|
||||
+4
-1
@@ -98,7 +98,10 @@ fun SmartPrinter.printImplementation(implementation: Implementation) {
|
||||
}
|
||||
|
||||
element.allFields.filter { it.type.contains("Symbol") && it !is FieldList }
|
||||
.takeIf { it.isNotEmpty() && !isInterface && !isAbstract && !element.type.contains("Reference") }
|
||||
.takeIf {
|
||||
it.isNotEmpty() && !isInterface && !isAbstract &&
|
||||
!element.type.contains("Reference") && !element.type.contains("ResolvedQualifier")
|
||||
}
|
||||
?.let { symbolFields ->
|
||||
println("init {")
|
||||
for (symbolField in symbolFields) {
|
||||
|
||||
Reference in New Issue
Block a user