diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirCallsEffectAnalyzer.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirCallsEffectAnalyzer.kt index a032d9da587..5b4c7b5723a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirCallsEffectAnalyzer.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirCallsEffectAnalyzer.kt @@ -51,13 +51,13 @@ object FirCallsEffectAnalyzer : FirControlFlowChecker() { val functionalTypeEffects = mutableMapOf, ConeCallsEffectDeclaration>() function.valueParameters.forEachIndexed { index, parameter -> - if (parameter.returnTypeRef.isFunctionalTypeRef(function.session)) { + if (parameter.returnTypeRef.isFunctionalTypeRef(function.declarationSiteSession)) { val effectDeclaration = function.contractDescription.getParameterCallsEffectDeclaration(index) if (effectDeclaration != null) functionalTypeEffects[parameter.symbol] = effectDeclaration } } - if (function.receiverTypeRef.isFunctionalTypeRef(function.session)) { + if (function.receiverTypeRef.isFunctionalTypeRef(function.declarationSiteSession)) { val effectDeclaration = function.contractDescription.getParameterCallsEffectDeclaration(-1) if (effectDeclaration != null) functionalTypeEffects[function.symbol] = effectDeclaration } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirReturnsImpliesAnalyzer.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirReturnsImpliesAnalyzer.kt index 1a7199cd7d2..f24db9efd66 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirReturnsImpliesAnalyzer.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirReturnsImpliesAnalyzer.kt @@ -50,7 +50,7 @@ object FirReturnsImpliesAnalyzer : FirControlFlowChecker() { if (effects.isNullOrEmpty()) return - val logicSystem = object : PersistentLogicSystem(function.session.typeContext) { + val logicSystem = object : PersistentLogicSystem(function.declarationSiteSession.typeContext) { override fun processUpdatedReceiverVariable(flow: PersistentFlow, variable: RealVariable) = throw IllegalStateException("Receiver variable update is not possible for this logic system") @@ -84,8 +84,8 @@ object FirReturnsImpliesAnalyzer : FirControlFlowChecker() { context: CheckerContext ): Boolean { val effect = effectDeclaration.effect as ConeReturnsEffectDeclaration - val builtinTypes = function.session.builtinTypes - val typeContext = function.session.typeContext + val builtinTypes = function.declarationSiteSession.builtinTypes + val typeContext = function.declarationSiteSession.typeContext val flow = dataFlowInfo.flowOnNodes.getValue(node) as PersistentFlow val isReturn = node is JumpNode && node.fir is FirReturnExpression @@ -104,7 +104,7 @@ object FirReturnsImpliesAnalyzer : FirControlFlowChecker() { if (effect.value != ConeConstantReference.WILDCARD) { val operation = effect.value.toOperation() - if (expressionType != null && expressionType.isInapplicableWith(operation, function.session)) return false + if (expressionType != null && expressionType.isInapplicableWith(operation, function.declarationSiteSession)) return false if (resultExpression is FirConstExpression<*>) { if (!resultExpression.isApplicableWith(operation)) return false @@ -179,7 +179,7 @@ object FirReturnsImpliesAnalyzer : FirControlFlowChecker() { is ConeIsNullPredicate -> { val fir = function.getParameterSymbol(arg.parameterIndex, context).fir val realVar = variableStorage.getOrCreateRealVariable(flow, fir.symbol, fir) - realVar?.to(simpleTypeStatement(realVar, isNegated, function.session.builtinTypes.anyType.type))?.let { mutableMapOf(it) } + realVar?.to(simpleTypeStatement(realVar, isNegated, function.declarationSiteSession.builtinTypes.anyType.type))?.let { mutableMapOf(it) } } is ConeLogicalNot -> arg.buildTypeStatements(function, logicSystem, variableStorage, flow, context) ?.mapValuesTo(mutableMapOf()) { (_, value) -> value.invert() } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirHelpers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirHelpers.kt index 987ef19ec1d..5495a1bd23a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirHelpers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirHelpers.kt @@ -62,8 +62,8 @@ fun FirClass<*>.isSuperclassOf(other: FirClass<*>): Boolean { */ fun FirClass<*>.isSuperclassOf(other: FirClass<*>, exclude: MutableSet>): Boolean { for (it in other.superTypeRefs) { - val that = it.firClassLike(session) - ?.followAllAlias(session) + val that = it.firClassLike(declarationSiteSession) + ?.followAllAlias(declarationSiteSession) ?.safeAs>() ?: continue @@ -96,8 +96,8 @@ fun FirClass<*>.isSupertypeOf(other: FirClass<*>): Boolean { */ fun FirClass<*>.isSupertypeOf(other: FirClass<*>, exclude: MutableSet>): Boolean { for (it in other.superTypeRefs) { - val candidate = it.firClassLike(session) - ?.followAllAlias(session) + val candidate = it.firClassLike(declarationSiteSession) + ?.followAllAlias(declarationSiteSession) ?.safeAs>() ?: continue diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirConflictsChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirConflictsChecker.kt index b08fef18b4b..a6ec260baf2 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirConflictsChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirConflictsChecker.kt @@ -81,7 +81,7 @@ object FirConflictsChecker : FirBasicDeclarationChecker() { session: FirSession ) { val conflicting = conflictingSymbol.fir as? FirDeclaration ?: return - if (declaration.session.moduleInfo != conflicting.session.moduleInfo) return + if (declaration.declarationSiteSession.moduleInfo != conflicting.declarationSiteSession.moduleInfo) return val actualConflictingPresentation = conflictingPresentation ?: presenter.represent(conflicting) if (conflicting == declaration || actualConflictingPresentation != declarationPresentation) return val actualConflictingFile = diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirExposedVisibilityDeclarationChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirExposedVisibilityDeclarationChecker.kt index 6450ce72150..6106cca64eb 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirExposedVisibilityDeclarationChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirExposedVisibilityDeclarationChecker.kt @@ -44,7 +44,7 @@ object FirExposedVisibilityDeclarationChecker : FirMemberDeclarationChecker() { val isInterface = declaration.classKind == ClassKind.INTERFACE for (supertypeRef in supertypes) { val supertype = supertypeRef.coneTypeSafe() ?: continue - val clazz = supertype.toRegularClass(declaration.session) ?: continue + val clazz = supertype.toRegularClass(declaration.declarationSiteSession) ?: continue val superIsInterface = clazz.classKind == ClassKind.INTERFACE if (superIsInterface != isInterface) { continue diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirNotImplementedOverrideChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirNotImplementedOverrideChecker.kt index 36338c17910..6c657be6d90 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirNotImplementedOverrideChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirNotImplementedOverrideChecker.kt @@ -58,7 +58,7 @@ object FirNotImplementedOverrideChecker : FirClassChecker() { !visibility.visibleFromPackage(classPackage, symbol.callableId.packageName) ) return true if (visibility == Visibilities.Internal && - session !== declaration.session + declarationSiteSession !== declaration.declarationSiteSession ) return true return false } diff --git a/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt b/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt index 68be74f52c1..9f19ee8288e 100644 --- a/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt +++ b/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt @@ -317,7 +317,7 @@ class MultiModuleHtmlFirDump(private val outputRoot: File) { require(inModule) val dumpOutput = index.files[file] ?: error("No location for ${file.name}") - val dumper = HtmlFirDump(LinkResolver(dumpOutput), file.session) + val dumper = HtmlFirDump(LinkResolver(dumpOutput), file.declarationSiteSession) val builder = StringBuilder() dumper.generate(file, builder) diff --git a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt index d6fe65b626f..70499ccefa9 100644 --- a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt +++ b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt @@ -200,7 +200,7 @@ class FirElementSerializer private constructor( @OptIn(ExperimentalStdlibApi::class) private fun FirClass<*>.declarations(): List> = buildList { val memberScope = - defaultType().scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing) + defaultType().scope(declarationSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing) ?: error("Null scope for $this") fun addDeclarationIfNeeded(symbol: FirCallableSymbol<*>) { @@ -946,17 +946,17 @@ class FirElementSerializer private constructor( ): FirElementSerializer { val parentClassId = klass.symbol.classId.outerClassId val parent = if (parentClassId != null && !parentClassId.isLocal) { - val parentClass = klass.session.symbolProvider.getClassLikeSymbolByFqName(parentClassId)!!.fir as FirRegularClass + val parentClass = klass.declarationSiteSession.symbolProvider.getClassLikeSymbolByFqName(parentClassId)!!.fir as FirRegularClass parentSerializer ?: create(scopeSession, parentClass, extension, null, typeApproximator) } else { - createTopLevel(klass.session, scopeSession, extension, typeApproximator) + createTopLevel(klass.declarationSiteSession, scopeSession, extension, typeApproximator) } // Calculate type parameter ids for the outer class beforehand, as it would've had happened if we were always // serializing outer classes before nested classes. // Otherwise our interner can get wrong ids because we may serialize classes in any order. val serializer = FirElementSerializer( - klass.session, + klass.declarationSiteSession, scopeSession, klass, Interner(parent.typeParameters), diff --git a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt index c755b2bc7f2..ec4444fadbc 100644 --- a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt +++ b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt @@ -210,8 +210,8 @@ class FirJvmSerializerExtension( private fun FirFunction<*>.needsInlineParameterNullCheckRequirement(): Boolean = this is FirSimpleFunction && isInline && !isSuspend && !isParamAssertionsDisabled && !Visibilities.isPrivate(visibility) && - (valueParameters.any { it.returnTypeRef.coneType.isBuiltinFunctionalType(session) } || - receiverTypeRef?.coneType?.isBuiltinFunctionalType(session) == true) + (valueParameters.any { it.returnTypeRef.coneType.isBuiltinFunctionalType(declarationSiteSession) } || + receiverTypeRef?.coneType?.isBuiltinFunctionalType(declarationSiteSession) == true) override fun serializeProperty( property: FirProperty, @@ -256,7 +256,7 @@ class FirJvmSerializerExtension( val container = dispatchReceiverType?.classId?.let { - session.firProvider.getFirClassifierByFqName(it) as? FirRegularClass + declarationSiteSession.firProvider.getFirClassifierByFqName(it) as? FirRegularClass } if (container == null || !container.isCompanion) { return false @@ -264,7 +264,7 @@ class FirJvmSerializerExtension( val grandParent = container.classId.outerClassId?.let { - session.firProvider.getFirClassifierByFqName(it) as? FirRegularClass + declarationSiteSession.firProvider.getFirClassifierByFqName(it) as? FirRegularClass } return grandParent != null && (grandParent.classKind == ClassKind.INTERFACE || grandParent.classKind == ClassKind.ANNOTATION_CLASS) diff --git a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirMetadataSerializer.kt b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirMetadataSerializer.kt index 685bf54258e..e4505cc194b 100644 --- a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirMetadataSerializer.kt +++ b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirMetadataSerializer.kt @@ -79,7 +79,7 @@ class FirMetadataSerializer( val function = this return buildAnonymousFunction { val typeParameterSet = function.typeParameters.filterIsInstanceTo(mutableSetOf()) - session = function.session + session = function.declarationSiteSession origin = FirDeclarationOrigin.Source symbol = FirAnonymousFunctionSymbol() returnTypeRef = function.returnTypeRef.approximated(toSuper = true, typeParameterSet) @@ -98,7 +98,7 @@ class FirMetadataSerializer( val accessor = this return buildPropertyAccessor { val typeParameterSet = accessor.typeParameters.toMutableSet() - session = accessor.session + session = accessor.declarationSiteSession origin = FirDeclarationOrigin.Source returnTypeRef = accessor.returnTypeRef.approximated(toSuper = true, typeParameterSet) symbol = FirPropertyAccessorSymbol() @@ -118,7 +118,7 @@ class FirMetadataSerializer( val property = this return buildProperty { val typeParameterSet = property.typeParameters.toMutableSet() - session = property.session + session = property.declarationSiteSession origin = FirDeclarationOrigin.Source symbol = FirPropertySymbol(property.symbol.callableId) returnTypeRef = property.returnTypeRef.approximated(toSuper = true, typeParameterSet) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index 7097a680ef9..cc8450322c3 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -739,7 +739,7 @@ class Fir2IrDeclarationStorage( val field = this return buildProperty { source = field.source - session = field.session + session = field.declarationSiteSession origin = field.origin returnTypeRef = field.returnTypeRef name = field.name diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt index 55a27c9ae95..e75290add66 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt @@ -14,7 +14,7 @@ sealed class FirMetadataSource : MetadataSource { abstract val fir: FirDeclaration val session: FirSession - get() = fir.session + get() = fir.declarationSiteSession override val name: Name? get() = when (val fir = fir) { diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaScopeProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaScopeProvider.kt index 53063899d88..cdebc904e71 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaScopeProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaScopeProvider.kt @@ -151,7 +151,7 @@ class JavaScopeProvider( private tailrec fun FirRegularClass.findJavaSuperClass(): FirRegularClass? { val superClass = superConeTypes.firstNotNullResult { - (it.lookupTag.toSymbol(session)?.fir as? FirRegularClass)?.takeIf { superClass -> + (it.lookupTag.toSymbol(declarationSiteSession)?.fir as? FirRegularClass)?.takeIf { superClass -> superClass.classKind == ClassKind.CLASS } } ?: return null @@ -166,7 +166,7 @@ class JavaScopeProvider( DFS.dfs(listOf(this), { regularClass -> regularClass.superConeTypes.mapNotNull { - it.lookupTag.toSymbol(session)?.fir as? FirRegularClass + it.lookupTag.toSymbol(declarationSiteSession)?.fir as? FirRegularClass } }, object : DFS.AbstractNodeHandler() { diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt index 5caf08692e8..b2470753973 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt @@ -213,7 +213,7 @@ class JavaSymbolProvider( ) { replaceSuperTypeRefs( javaClass.supertypes.map { supertype -> - supertype.toFirResolvedTypeRef(session, javaTypeParameterStack, isForSupertypes = true, forTypeParameterBounds = false) + supertype.toFirResolvedTypeRef(declarationSiteSession, javaTypeParameterStack, isForSupertypes = true, forTypeParameterBounds = false) } ) } @@ -354,7 +354,7 @@ class JavaSymbolProvider( valueParametersForAnnotationConstructor.forEach { javaMethod, firValueParameter -> javaMethod.annotationParameterDefaultValue?.let { javaDefaultValue -> firValueParameter.defaultValue = - javaDefaultValue.toFirExpression(session, javaTypeParameterStack, firValueParameter.returnTypeRef) + javaDefaultValue.toFirExpression(declarationSiteSession, javaTypeParameterStack, firValueParameter.returnTypeRef) } } } diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt index 238e0e4f4e2..96f237cb3fa 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt @@ -435,7 +435,7 @@ private fun FirRegularClass.createRawArguments( val erasedUpperBound = typeParameter.getErasedUpperBound { defaultType().withArguments(defaultArgs.toTypedArray()) } - computeRawProjection(session, typeParameter, position, erasedUpperBound) + computeRawProjection(declarationSiteSession, typeParameter, position, erasedUpperBound) } private fun buildEnumCall(session: FirSession, classId: ClassId?, entryName: Name?) = diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaClass.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaClass.kt index 0168bd9cc48..9172a207d88 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaClass.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaClass.kt @@ -31,7 +31,7 @@ import kotlin.properties.Delegates @OptIn(FirImplementationDetail::class) class FirJavaClass @FirImplementationDetail internal constructor( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val name: Name, override val annotations: MutableList, diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaConstructor.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaConstructor.kt index 3175cadd03e..1c5ac189075 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaConstructor.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaConstructor.kt @@ -29,7 +29,7 @@ import kotlin.properties.Delegates @OptIn(FirImplementationDetail::class) class FirJavaConstructor @FirImplementationDetail constructor( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override val symbol: FirConstructorSymbol, override val isPrimary: Boolean, override var returnTypeRef: FirTypeRef, diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaField.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaField.kt index 723e21bf066..1a99535ca9f 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaField.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaField.kt @@ -33,7 +33,7 @@ import kotlin.properties.Delegates @OptIn(FirImplementationDetail::class) class FirJavaField @FirImplementationDetail constructor( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override val symbol: FirFieldSymbol, override val name: Name, override var resolvePhase: FirResolvePhase, diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaMethod.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaMethod.kt index b8450c41e19..b457c268c2d 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaMethod.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaMethod.kt @@ -51,7 +51,7 @@ import kotlin.properties.Delegates @OptIn(FirImplementationDetail::class) class FirJavaMethod @FirImplementationDetail constructor( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val attributes: FirDeclarationAttributes, override var returnTypeRef: FirTypeRef, @@ -235,7 +235,7 @@ inline fun buildJavaMethodCopy(original: FirSimpleFunction, init: FirJavaMethodB } val copyBuilder = FirJavaMethodBuilder() copyBuilder.source = original.source - copyBuilder.session = original.session + copyBuilder.session = original.declarationSiteSession copyBuilder.resolvePhase = original.resolvePhase copyBuilder.attributes = original.attributes.copy() copyBuilder.returnTypeRef = original.returnTypeRef diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaValueParameter.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaValueParameter.kt index fd478100588..cb17e5dc3bb 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaValueParameter.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaValueParameter.kt @@ -27,7 +27,7 @@ import kotlin.contracts.contract @OptIn(FirImplementationDetail::class) class FirJavaValueParameter @FirImplementationDetail constructor( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val attributes: FirDeclarationAttributes, override var returnTypeRef: FirTypeRef, @@ -182,7 +182,7 @@ inline fun buildJavaValueParameterCopy(original: FirValueParameter, init: FirJav } val copyBuilder = FirJavaValueParameterBuilder() copyBuilder.source = original.source - copyBuilder.session = original.session + copyBuilder.session = original.declarationSiteSession copyBuilder.attributes = original.attributes.copy() copyBuilder.returnTypeRef = original.returnTypeRef copyBuilder.name = original.name diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt index 2e3d10cb00b..978ff3f8581 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt @@ -382,13 +382,13 @@ class JavaClassUseSiteMemberScope( } private fun FirFunction<*>.computeJvmSignature(): String? { - return computeJvmSignature { it.toConeKotlinTypeProbablyFlexible(session, typeParameterStack) } + return computeJvmSignature { it.toConeKotlinTypeProbablyFlexible(declarationSiteSession, typeParameterStack) } } private fun FirFunction<*>.computeJvmDescriptor(customName: String? = null, includeReturnType: Boolean = false): String { return computeJvmDescriptor(customName, includeReturnType) { it.toConeKotlinTypeProbablyFlexible( - session, + declarationSiteSession, typeParameterStack ) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/CopyUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/CopyUtils.kt index f35752201f6..406d332ab70 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/CopyUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/CopyUtils.kt @@ -61,7 +61,7 @@ fun FirFunctionCall.copy( fun FirAnonymousFunction.copy( receiverTypeRef: FirTypeRef? = this.receiverTypeRef, source: FirSourceElement? = this.source, - session: FirSession = this.session, + session: FirSession = this.declarationSiteSession, origin: FirDeclarationOrigin = this.origin, returnTypeRef: FirTypeRef = this.returnTypeRef, valueParameters: List = this.valueParameters, @@ -116,7 +116,7 @@ fun FirTypeParameter.copy( ): FirTypeParameter { return buildTypeParameter { source = this@copy.source - session = this@copy.session + session = this@copy.declarationSiteSession name = this@copy.name symbol = this@copy.symbol variance = this@copy.variance diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirVisibilityChecker.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirVisibilityChecker.kt index 03115ae707b..3125187ec4f 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirVisibilityChecker.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirVisibilityChecker.kt @@ -70,11 +70,11 @@ abstract class FirVisibilityChecker : FirSessionComponent { val symbol = declaration.symbol return when (declaration.visibility) { Visibilities.Internal -> { - declaration.session == session || session.moduleVisibilityChecker?.isInFriendModule(declaration) == true + declaration.declarationSiteSession == session || session.moduleVisibilityChecker?.isInFriendModule(declaration) == true } Visibilities.Private, Visibilities.PrivateToThis -> { val ownerId = symbol.getOwnerId() - if (declaration.session == session) { + if (declaration.declarationSiteSession == session) { when { ownerId == null -> { val candidateFile = when (symbol) { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt index 6ee733ff5ee..8527cde319c 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt @@ -361,7 +361,7 @@ private fun initialTypeOfCandidate(candidate: Candidate, typeRef: FirResolvedTyp inline val FirCallableDeclaration<*>.containingClass: FirRegularClass? get() = this.containingClassAttr?.let { lookupTag -> - session.symbolProvider.getSymbolByLookupTag(lookupTag)?.fir as? FirRegularClass + declarationSiteSession.symbolProvider.getSymbolByLookupTag(lookupTag)?.fir as? FirRegularClass } val FirFunction<*>.asForbiddenNamedArgumentsTarget: ForbiddenNamedArgumentsTarget? diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt index d3609fc9e3f..334ccbb4f35 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt @@ -195,7 +195,7 @@ internal object CheckVisibility : CheckerStage() { if (declaration is FirConstructor) { // TODO: Should be some other form - val classSymbol = declaration.returnTypeRef.coneTypeUnsafe().lookupTag.toSymbol(declaration.session) + val classSymbol = declaration.returnTypeRef.coneTypeUnsafe().lookupTag.toSymbol(declaration.declarationSiteSession) if (classSymbol is FirRegularClassSymbol) { if (classSymbol.fir.classKind.isSingleton) { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArguments.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArguments.kt index 08a4a468c52..8f49f0437f6 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArguments.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArguments.kt @@ -77,7 +77,7 @@ private fun extraLambdaInfo( ?: expectedType?.typeArguments?.singleOrNull()?.safeAs()?.type?.takeIf { isFunctionSupertype } ?: typeVariable.defaultType - val nothingType = argument.session.builtinTypes.nothingType.type + val nothingType = argument.declarationSiteSession.builtinTypes.nothingType.type val parameters = argument.valueParameters.map { it.returnTypeRef.coneTypeSafe() ?: nothingType } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/Substitutors.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/Substitutors.kt index 9823ddf9584..38fa02b3416 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/Substitutors.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/Substitutors.kt @@ -156,7 +156,7 @@ data class ConeSubstitutorByMap(val substitution: Map( } protected fun checkSessionConsistency(file: FirFile) { - assert(session === file.session) { + assert(session === file.declarationSiteSession) { "File ${file.name} and transformer ${this::class} have inconsistent sessions" } } -} \ No newline at end of file +} diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSealedClassInheritorsProcessor.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSealedClassInheritorsProcessor.kt index cb99375bc3a..f5849dcc667 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSealedClassInheritorsProcessor.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSealedClassInheritorsProcessor.kt @@ -48,7 +48,7 @@ class FirSealedClassInheritorsProcessor( data.computeIfAbsent(regularClass) { mutableListOf() } } - val symbolProvider = regularClass.session.symbolProvider + val symbolProvider = regularClass.declarationSiteSession.symbolProvider for (typeRef in regularClass.superTypeRefs) { val parent = extractClassFromTypeRef(symbolProvider, typeRef).takeIf { it?.modality == Modality.SEALED } ?: continue diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirStatusResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirStatusResolveTransformer.kt index 993b4f35557..1bddb2aa23f 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirStatusResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirStatusResolveTransformer.kt @@ -390,7 +390,7 @@ abstract class AbstractFirStatusResolveTransformer( return } if (regularClass.resolvePhase > FirResolvePhase.STATUS) return - val firProvider = regularClass.session.firProvider + val firProvider = regularClass.declarationSiteSession.firProvider val statusComputationStatus = statusComputationSession[regularClass] if (!statusComputationStatus.requiresComputation) return diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/PhaseUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/PhaseUtils.kt index c1682a74585..3a34af3671b 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/PhaseUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/PhaseUtils.kt @@ -23,7 +23,7 @@ fun AbstractFirBasedSymbol<*>.ensureResolved( // TODO: Decide which one session should be used and probably get rid of the parameter if use-site session is not needed @Suppress("UNUSED_PARAMETER") useSiteSession: FirSession, ) { - val session = (fir as FirDeclaration).session + val session = (fir as FirDeclaration).declarationSiteSession val phaseManager = session.phaseManager phaseManager.ensureResolved(this, requiredPhase) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirPluginAnnotationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirPluginAnnotationsResolveTransformer.kt index 0821f95af3e..371ac070ba8 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirPluginAnnotationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirPluginAnnotationsResolveTransformer.kt @@ -43,7 +43,7 @@ class FirPluginAnnotationsResolveTransformer( override fun transformFile(file: FirFile, data: Any?): FirFile { checkSessionConsistency(file) if (!extensionService.hasPredicateBasedExtensions) return file - val registeredPluginAnnotations = file.session.registeredPluginAnnotations + val registeredPluginAnnotations = file.declarationSiteSession.registeredPluginAnnotations file.replaceResolvePhase(FirResolvePhase.ANNOTATIONS_FOR_PLUGINS) val newAnnotations = file.resolveAnnotations(registeredPluginAnnotations.annotations, registeredPluginAnnotations.metaAnnotations) if (!newAnnotations.isEmpty) { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirAbstractImportingScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirAbstractImportingScope.kt index 2332520ddf4..69b0f8fe9a9 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirAbstractImportingScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirAbstractImportingScope.kt @@ -37,7 +37,7 @@ enum class FirImportingScopeFilter { // though, "unknown" will always become public anyway. Visibilities.Unknown -> true Visibilities.Internal -> - symbol.fir.session == session || session.moduleVisibilityChecker?.isInFriendModule(fir) == true + symbol.fir.declarationSiteSession == session || session.moduleVisibilityChecker?.isInFriendModule(fir) == true // All non-`internal` visibilities are either even more restrictive (e.g. `private`) or must not // be checked in imports (e.g. `protected` may be valid in some use sites). else -> !fir.status.visibility.mustCheckInImports() diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassDeclaredMemberScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassDeclaredMemberScope.kt index c5ee12605ad..37d2b0c6578 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassDeclaredMemberScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassDeclaredMemberScope.kt @@ -65,7 +65,7 @@ class FirClassDeclaredMemberScope( val symbols = callablesIndex[name] ?: emptyList() for (symbol in symbols) { if (symbol is D) { - symbol.ensureResolvedForCalls(symbol.fir.session) + symbol.ensureResolvedForCalls(symbol.fir.declarationSiteSession) processor(symbol) } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirDeclaredMemberScopeProvider.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirDeclaredMemberScopeProvider.kt index 7d8131ad8e6..f9ace8c8cf9 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirDeclaredMemberScopeProvider.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirDeclaredMemberScopeProvider.kt @@ -59,7 +59,7 @@ class FirDeclaredMemberScopeProvider : FirSessionComponent { fun declaredMemberScope(klass: FirClass<*>): FirClassDeclaredMemberScope { return klass - .session + .declarationSiteSession .declaredMemberScopeProvider .declaredMemberScope(klass, useLazyNestedClassifierScope = false, existingNames = null, symbolProvider = null) } @@ -70,14 +70,14 @@ fun declaredMemberScopeWithLazyNestedScope( symbolProvider: FirSymbolProvider ): FirScope { return klass - .session + .declarationSiteSession .declaredMemberScopeProvider .declaredMemberScope(klass, useLazyNestedClassifierScope = true, existingNames = existingNames, symbolProvider = symbolProvider) } fun nestedClassifierScope(klass: FirClass<*>): FirNestedClassifierScope? { return klass - .session + .declarationSiteSession .declaredMemberScopeProvider .nestedClassifierScope(klass) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirFakeOverrideGenerator.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirFakeOverrideGenerator.kt index 9a4edcd8617..873e896efe8 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirFakeOverrideGenerator.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirFakeOverrideGenerator.kt @@ -465,7 +465,7 @@ object FirFakeOverrideGenerator { if (typeParameter !is FirTypeParameter) return@map null FirTypeParameterBuilder().apply { source = typeParameter.source - session = typeParameter.session + session = typeParameter.declarationSiteSession origin = FirDeclarationOrigin.SubstitutionOverride name = typeParameter.name symbol = FirTypeParameterSymbol() diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt index ff5ddbe9124..b8d38484c6c 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt @@ -344,7 +344,7 @@ class FirTypeIntersectionScope private constructor( val newSymbol = FirIntersectionOverridePropertySymbol(mostSpecific.callableId, overrides) val mostSpecificProperty = mostSpecific.fir FirFakeOverrideGenerator.createCopyForFirProperty( - newSymbol, mostSpecificProperty, mostSpecificProperty.session, FirDeclarationOrigin.IntersectionOverride, + newSymbol, mostSpecificProperty, mostSpecificProperty.declarationSiteSession, FirDeclarationOrigin.IntersectionOverride, newModality = newModality, newVisibility = newVisibility, newDispatchReceiverType = dispatchReceiverType, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnnotatedDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnnotatedDeclaration.kt index 379587a86ec..8a9b8718943 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnnotatedDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnnotatedDeclaration.kt @@ -19,7 +19,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed interface FirAnnotatedDeclaration : FirDeclaration, FirAnnotationContainer { override val source: FirSourceElement? - override val session: FirSession + override val declarationSiteSession: FirSession override val resolvePhase: FirResolvePhase override val origin: FirDeclarationOrigin override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousFunction.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousFunction.kt index ac399e73b9f..85d1c85e0ee 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousFunction.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousFunction.kt @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirAnonymousFunction : FirFunction, FirExpression(), FirTypeParametersOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousInitializer.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousInitializer.kt index 4c8956dfa35..1c0e8324397 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousInitializer.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousInitializer.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirAnonymousInitializer : FirPureAbstractElement(), FirDeclaration, FirSymbolOwner, FirControlFlowGraphOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousObject.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousObject.kt index 3d7174e66d9..e33735f8136 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousObject.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousObject.kt @@ -24,7 +24,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirAnonymousObject : FirClass, FirControlFlowGraphOwner, FirExpression() { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableDeclaration.kt index a4e19dac335..67fb350b2fc 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableDeclaration.kt @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed interface FirCallableDeclaration> : FirTypedDeclaration, FirSymbolOwner { override val source: FirSourceElement? - override val session: FirSession + override val declarationSiteSession: FirSession override val resolvePhase: FirResolvePhase override val origin: FirDeclarationOrigin override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableMemberDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableMemberDeclaration.kt index 9acdeb5dee2..f571e4f190c 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableMemberDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableMemberDeclaration.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed interface FirCallableMemberDeclaration> : FirCallableDeclaration, FirMemberDeclaration { override val source: FirSourceElement? - override val session: FirSession + override val declarationSiteSession: FirSession override val resolvePhase: FirResolvePhase override val origin: FirDeclarationOrigin override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClass.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClass.kt index 040316e5b66..839fe71ebdc 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClass.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClass.kt @@ -23,7 +23,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed interface FirClass> : FirClassLikeDeclaration, FirStatement, FirTypeParameterRefsOwner { override val source: FirSourceElement? - override val session: FirSession + override val declarationSiteSession: FirSession override val resolvePhase: FirResolvePhase override val origin: FirDeclarationOrigin override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClassLikeDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClassLikeDeclaration.kt index 99137b1c06f..4ba8da3cc4f 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClassLikeDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClassLikeDeclaration.kt @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed interface FirClassLikeDeclaration> : FirAnnotatedDeclaration, FirStatement, FirSymbolOwner { override val source: FirSourceElement? - override val session: FirSession + override val declarationSiteSession: FirSession override val resolvePhase: FirResolvePhase override val origin: FirDeclarationOrigin override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt index 15fc467d627..7ddf11ca035 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt @@ -26,7 +26,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirConstructor : FirPureAbstractElement(), FirFunction, FirCallableMemberDeclaration, FirTypeParameterRefsOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirDeclaration.kt index a803fd1fde9..4b8bddb71eb 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirDeclaration.kt @@ -17,7 +17,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed interface FirDeclaration : FirElement { override val source: FirSourceElement? - val session: FirSession + val declarationSiteSession: FirSession val resolvePhase: FirResolvePhase val origin: FirDeclarationOrigin val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt index 29058c9baef..74b0b0d6dcc 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirEnumEntry : FirVariable(), FirCallableMemberDeclaration { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorFunction.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorFunction.kt index c3b70bf0bf9..f20f17f848c 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorFunction.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorFunction.kt @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirErrorFunction : FirPureAbstractElement(), FirFunction, FirDiagnosticHolder, FirTypeParametersOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorProperty.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorProperty.kt index 8e7cf4b74da..b41724aacb9 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorProperty.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorProperty.kt @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirErrorProperty : FirVariable(), FirDiagnosticHolder, FirTypeParametersOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirField.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirField.kt index 35b9103594a..2a89279ace0 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirField.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirField.kt @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirField : FirVariable(), FirTypeParametersOwner, FirCallableMemberDeclaration { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFile.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFile.kt index a7cf1446b11..74c2bab5c1c 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFile.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFile.kt @@ -20,7 +20,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirFile : FirPureAbstractElement(), FirAnnotatedDeclaration { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFunction.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFunction.kt index 7171629e38c..77d7bb30075 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFunction.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFunction.kt @@ -24,7 +24,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed interface FirFunction> : FirCallableDeclaration, FirTargetElement, FirTypeParameterRefsOwner, FirControlFlowGraphOwner, FirStatement { override val source: FirSourceElement? - override val session: FirSession + override val declarationSiteSession: FirSession override val resolvePhase: FirResolvePhase override val origin: FirDeclarationOrigin override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt index 349da001219..c61d239ae2f 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt @@ -18,7 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed interface FirMemberDeclaration : FirAnnotatedDeclaration, FirTypeParameterRefsOwner { override val source: FirSourceElement? - override val session: FirSession + override val declarationSiteSession: FirSession override val resolvePhase: FirResolvePhase override val origin: FirDeclarationOrigin override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirProperty.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirProperty.kt index 4d4b5b6ba7c..3054ce7be0f 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirProperty.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirProperty.kt @@ -27,7 +27,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirProperty : FirVariable(), FirTypeParametersOwner, FirControlFlowGraphOwner, FirCallableMemberDeclaration { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt index 4abb44642d9..61962e94d9a 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt @@ -26,7 +26,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirPropertyAccessor : FirPureAbstractElement(), FirFunction, FirCallableMemberDeclaration, FirContractDescriptionOwner, FirTypeParametersOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirRegularClass.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirRegularClass.kt index cc7d5b4ec81..8165d34fb07 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirRegularClass.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirRegularClass.kt @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirRegularClass : FirPureAbstractElement(), FirMemberDeclaration, FirTypeParameterRefsOwner, FirControlFlowGraphOwner, FirClass { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirSimpleFunction.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirSimpleFunction.kt index 4b3ff135569..2dec55aee2f 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirSimpleFunction.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirSimpleFunction.kt @@ -27,7 +27,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirSimpleFunction : FirPureAbstractElement(), FirFunction, FirCallableMemberDeclaration, FirContractDescriptionOwner, FirTypeParametersOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt index 620c206c8ba..8f78b5b1ea8 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirTypeAlias : FirPureAbstractElement(), FirClassLikeDeclaration, FirMemberDeclaration, FirTypeParametersOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParameter.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParameter.kt index ba12a591d3b..eedd4ece2dc 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParameter.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParameter.kt @@ -24,7 +24,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirTypeParameter : FirPureAbstractElement(), FirTypeParameterRef, FirAnnotatedDeclaration, FirSymbolOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt index 937b74bc717..384eb44e437 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt @@ -19,7 +19,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed interface FirTypedDeclaration : FirAnnotatedDeclaration { override val source: FirSourceElement? - override val session: FirSession + override val declarationSiteSession: FirSession override val resolvePhase: FirResolvePhase override val origin: FirDeclarationOrigin override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirValueParameter.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirValueParameter.kt index 7525fa89011..b1d1b6bd156 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirValueParameter.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirValueParameter.kt @@ -24,7 +24,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirValueParameter : FirVariable(), FirControlFlowGraphOwner { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirVariable.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirVariable.kt index 10edf2a473e..93c2e4547c4 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirVariable.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirVariable.kt @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.fir.visitors.* sealed class FirVariable> : FirPureAbstractElement(), FirCallableDeclaration, FirAnnotatedDeclaration, FirStatement { abstract override val source: FirSourceElement? - abstract override val session: FirSession + abstract override val declarationSiteSession: FirSession abstract override val resolvePhase: FirResolvePhase abstract override val origin: FirDeclarationOrigin abstract override val attributes: FirDeclarationAttributes diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirConstructorBuilder.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirConstructorBuilder.kt index 3e99df53279..5e77add7db9 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirConstructorBuilder.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirConstructorBuilder.kt @@ -98,7 +98,7 @@ inline fun buildConstructorCopy(original: FirConstructor, init: FirConstructorBu } val copyBuilder = FirConstructorBuilder() copyBuilder.source = original.source - copyBuilder.session = original.session + copyBuilder.session = original.declarationSideSession copyBuilder.resolvePhase = original.resolvePhase copyBuilder.origin = original.origin copyBuilder.attributes = original.attributes.copy() diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyAccessorBuilder.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyAccessorBuilder.kt index 36240157be4..c056f12fadf 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyAccessorBuilder.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyAccessorBuilder.kt @@ -95,7 +95,7 @@ inline fun buildPropertyAccessorCopy(original: FirPropertyAccessor, init: FirPro } val copyBuilder = FirPropertyAccessorBuilder() copyBuilder.source = original.source - copyBuilder.session = original.session + copyBuilder.session = original.declarationSideSession copyBuilder.resolvePhase = original.resolvePhase copyBuilder.origin = original.origin copyBuilder.attributes = original.attributes.copy() diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyBuilder.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyBuilder.kt index 628ac0f7383..57f6a0c77cd 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyBuilder.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyBuilder.kt @@ -104,7 +104,7 @@ inline fun buildPropertyCopy(original: FirProperty, init: FirPropertyBuilder.() } val copyBuilder = FirPropertyBuilder() copyBuilder.source = original.source - copyBuilder.session = original.session + copyBuilder.session = original.declarationSideSession copyBuilder.resolvePhase = original.resolvePhase copyBuilder.origin = original.origin copyBuilder.attributes = original.attributes.copy() diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirSimpleFunctionBuilder.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirSimpleFunctionBuilder.kt index d9c66697449..4d5e9fad2a5 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirSimpleFunctionBuilder.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirSimpleFunctionBuilder.kt @@ -96,7 +96,7 @@ inline fun buildSimpleFunctionCopy(original: FirSimpleFunction, init: FirSimpleF } val copyBuilder = FirSimpleFunctionBuilder() copyBuilder.source = original.source - copyBuilder.session = original.session + copyBuilder.session = original.declarationSideSession copyBuilder.resolvePhase = original.resolvePhase copyBuilder.origin = original.origin copyBuilder.attributes = original.attributes.copy() diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirValueParameterBuilder.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirValueParameterBuilder.kt index 01a2497dd11..572b2887172 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirValueParameterBuilder.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirValueParameterBuilder.kt @@ -81,7 +81,7 @@ inline fun buildValueParameterCopy(original: FirValueParameter, init: FirValuePa } val copyBuilder = FirValueParameterBuilder() copyBuilder.source = original.source - copyBuilder.session = original.session + copyBuilder.session = original.declarationSideSession copyBuilder.resolvePhase = original.resolvePhase copyBuilder.origin = original.origin copyBuilder.attributes = original.attributes.copy() diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousFunctionImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousFunctionImpl.kt index c2b57f8c75f..d05043a12f7 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousFunctionImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousFunctionImpl.kt @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirAnonymousFunctionImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, override val annotations: MutableList, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousInitializerImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousInitializerImpl.kt index 2436ec66910..05c6fa945b2 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousInitializerImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousInitializerImpl.kt @@ -23,7 +23,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirAnonymousInitializerImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousObjectImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousObjectImpl.kt index 0ae6e17d56a..ad2076fd512 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousObjectImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousObjectImpl.kt @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirAnonymousObjectImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirConstructorImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirConstructorImpl.kt index 2e546d3d239..38ca2a8a065 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirConstructorImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirConstructorImpl.kt @@ -31,7 +31,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirConstructorImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirDefaultSetterValueParameter.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirDefaultSetterValueParameter.kt index 1cf8e0828b6..8185160916e 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirDefaultSetterValueParameter.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirDefaultSetterValueParameter.kt @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirDefaultSetterValueParameter( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirEnumEntryImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirEnumEntryImpl.kt index 90dfe6d5647..a212167d277 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirEnumEntryImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirEnumEntryImpl.kt @@ -31,7 +31,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirEnumEntryImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorFunctionImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorFunctionImpl.kt index 308d2970346..95a66ab605a 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorFunctionImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorFunctionImpl.kt @@ -29,7 +29,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirErrorFunctionImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorPropertyImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorPropertyImpl.kt index 098421de3c1..028c95a9dc6 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorPropertyImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorPropertyImpl.kt @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirErrorPropertyImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFieldImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFieldImpl.kt index c622ba4bfde..570cc76b5d4 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFieldImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFieldImpl.kt @@ -32,7 +32,7 @@ import org.jetbrains.kotlin.fir.visitors.* class FirFieldImpl @FirImplementationDetail constructor( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFileImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFileImpl.kt index 763006fa1b7..a6794708923 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFileImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFileImpl.kt @@ -24,7 +24,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirFileImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPrimaryConstructor.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPrimaryConstructor.kt index e423ad4bcd5..06a58b0c077 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPrimaryConstructor.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPrimaryConstructor.kt @@ -31,7 +31,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirPrimaryConstructor( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyAccessorImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyAccessorImpl.kt index 720f5d7ed97..cfa2256b831 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyAccessorImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyAccessorImpl.kt @@ -33,7 +33,7 @@ import org.jetbrains.kotlin.fir.visitors.* open class FirPropertyAccessorImpl @FirImplementationDetail constructor( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyImpl.kt index 50c3b243118..688409f772c 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyImpl.kt @@ -33,7 +33,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirPropertyImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirRegularClassImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirRegularClassImpl.kt index 8dc759e244b..23abf875199 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirRegularClassImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirRegularClassImpl.kt @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirRegularClassImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSimpleFunctionImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSimpleFunctionImpl.kt index 54e89e324e9..7b9fced47a2 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSimpleFunctionImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSimpleFunctionImpl.kt @@ -32,7 +32,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirSimpleFunctionImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeAliasImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeAliasImpl.kt index 35cb3daa4d3..1abb1037256 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeAliasImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeAliasImpl.kt @@ -26,7 +26,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirTypeAliasImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeParameterImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeParameterImpl.kt index 7261aaca6d4..2cbbcd95c8d 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeParameterImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeParameterImpl.kt @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirTypeParameterImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirValueParameterImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirValueParameterImpl.kt index 25ff32c990b..b95dac50095 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirValueParameterImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirValueParameterImpl.kt @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirValueParameterImpl( override val source: FirSourceElement?, - override val session: FirSession, + override val declarationSiteSession: FirSession, override var resolvePhase: FirResolvePhase, override val origin: FirDeclarationOrigin, override val attributes: FirDeclarationAttributes, diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt index d6adcd91ade..62a56202124 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource class FirSyntheticProperty( - override val session: FirSession, + override val declarationSiteSession: FirSession, override val name: Name, override val isVar: Boolean, override val symbol: FirAccessorSymbol, diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticPropertyAccessor.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticPropertyAccessor.kt index ca23b2b789e..4e56651b8cb 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticPropertyAccessor.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticPropertyAccessor.kt @@ -28,8 +28,8 @@ class FirSyntheticPropertyAccessor( override val source: FirSourceElement? get() = delegate.source - override val session: FirSession - get() = delegate.session + override val declarationSiteSession: FirSession + get() = delegate.declarationSiteSession override val origin: FirDeclarationOrigin get() = FirDeclarationOrigin.Synthetic diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticTest.kt index 6788b32fb4d..2d4cfb27b8d 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticTest.kt @@ -266,7 +266,7 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() { val collectors = mutableMapOf() val result = mutableMapOf>>() for (firFile in firFiles) { - val session = firFile.session + val session = firFile.declarationSiteSession val collector = collectors.computeIfAbsent(session) { createCollector(session) } result[firFile] = collector.collectDiagnostics(firFile).toList() } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirResolveBench.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirResolveBench.kt index 091ac24e3af..2964fbf0e67 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirResolveBench.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirResolveBench.kt @@ -35,7 +35,7 @@ import kotlin.system.measureNanoTime fun checkFirProvidersConsistency(firFiles: List) { - for ((session, files) in firFiles.groupBy { it.session }) { + for ((session, files) in firFiles.groupBy { it.declarationSiteSession }) { val provider = session.firProvider as FirProviderImpl provider.ensureConsistent(files) } diff --git a/compiler/visualizer/render-fir/src/org/jetbrains/kotlin/compiler/visualizer/FirVisualizer.kt b/compiler/visualizer/render-fir/src/org/jetbrains/kotlin/compiler/visualizer/FirVisualizer.kt index 3efc8e5938a..99b0a05bb23 100644 --- a/compiler/visualizer/render-fir/src/org/jetbrains/kotlin/compiler/visualizer/FirVisualizer.kt +++ b/compiler/visualizer/render-fir/src/org/jetbrains/kotlin/compiler/visualizer/FirVisualizer.kt @@ -316,10 +316,10 @@ class FirVisualizer(private val firFile: FirFile) : BaseRenderer() { } inner class FirRendererForVisualizer : FirVisitor() { - private val session = firFile.session + private val session = firFile.declarationSiteSession private val filePackage = firFile.packageFqName.toString() private val filePackageWithSlash = filePackage.replace(".", "/") - private val symbolProvider = firFile.session.symbolProvider + private val symbolProvider = firFile.declarationSiteSession.symbolProvider private fun ConeTypeProjection.tryToRenderConeAsFunctionType(): String { if (this !is ConeKotlinType) return localTypeRenderer() diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateImpl.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateImpl.kt index a95a41fd9e7..69b1a0857f7 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateImpl.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateImpl.kt @@ -115,7 +115,7 @@ internal class FirModuleResolveStateImpl( sessionProvider.getModuleCache(ktDeclaration.getModuleInfo() as ModuleSourceInfo) ) if (container.resolvePhase < FirResolvePhase.BODY_RESOLVE) { - val cache = (container.session as FirIdeSourcesSession).cache + val cache = (container.declarationSiteSession as FirIdeSourcesSession).cache firLazyDeclarationResolver.lazyResolveDeclaration( container, cache, @@ -142,7 +142,7 @@ internal class FirModuleResolveStateImpl( } override fun resolvedFirToPhase(declaration: D, toPhase: FirResolvePhase): D { - val fileCache = when (val session = declaration.session) { + val fileCache = when (val session = declaration.declarationSiteSession) { is FirIdeSourcesSession -> session.cache else -> return declaration } @@ -165,7 +165,7 @@ internal class FirModuleResolveStateImpl( firDeclaration, rootModuleSession.cache, containerFirFile, - containerFirFile.session.firIdeProvider, + containerFirFile.declarationSiteSession.firIdeProvider, fromPhase = firDeclaration.resolvePhase, toPhase = FirResolvePhase.BODY_RESOLVE, towerDataContextCollector = collector, @@ -180,4 +180,4 @@ internal class FirModuleResolveStateImpl( override fun getTowerDataContextForElement(element: KtElement): FirTowerDataContext? { return collector.getClosestAvailableParentContext(element) } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirPhaseRunner.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirPhaseRunner.kt index d034ac0dbd9..017f6534f27 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirPhaseRunner.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirPhaseRunner.kt @@ -63,7 +63,7 @@ internal class FirPhaseRunner { } private fun runPhaseWithoutLock(firFile: FirFile, phase: FirResolvePhase, scopeSession: ScopeSession) { - val phaseProcessor = phase.createTransformerBasedProcessorByPhase(firFile.session, scopeSession) + val phaseProcessor = phase.createTransformerBasedProcessorByPhase(firFile.declarationSiteSession, scopeSession) executeWithoutPCE { FirLazyBodiesCalculator.calculateLazyBodiesIfPhaseRequires(firFile, phase) phaseProcessor.processFile(firFile) @@ -91,4 +91,4 @@ internal fun FirResolvePhase.createTransformerBasedProcessorByPhase( FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE -> FirImplicitTypeBodyResolveProcessor(session, scopeSession) FirResolvePhase.BODY_RESOLVE -> FirBodyResolveProcessor(session, scopeSession) } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/IdeFirPhaseManager.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/IdeFirPhaseManager.kt index c77f307d9bf..734868300f8 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/IdeFirPhaseManager.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/IdeFirPhaseManager.kt @@ -28,7 +28,7 @@ internal class IdeFirPhaseManager( try { lazyDeclarationResolver.lazyResolveDeclaration(fir, cache, requiredPhase, checkPCE = true) } catch (e: Throwable) { - sessionInvalidator.invalidate(fir.session) + sessionInvalidator.invalidate(fir.declarationSiteSession) throw e } } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirDeclarationDesignation.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirDeclarationDesignation.kt index 99cf6570348..a06ea26b18a 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirDeclarationDesignation.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirDeclarationDesignation.kt @@ -28,10 +28,10 @@ class FirDeclarationDesignation( object DeclarationDesignationCollector { fun collectDesignation(declaration: FirDeclaration): FirDeclarationDesignation { - val firProvider = declaration.session.firProvider + val firProvider = declaration.declarationSiteSession.firProvider val containingClass = when (declaration) { - is FirCallableDeclaration<*> -> declaration.containingClass()?.toFirRegularClass(declaration.session) + is FirCallableDeclaration<*> -> declaration.containingClass()?.toFirRegularClass(declaration.declarationSiteSession) is FirClassLikeDeclaration<*> -> declaration.symbol.classId.outerClassId?.let(firProvider::getFirClassifierByFqName) else -> error("Invalid declaration ${declaration.renderWithType()}") } ?: return FirDeclarationDesignation(emptyList(), declaration, isLocalDesignation = false) @@ -54,7 +54,7 @@ object DeclarationDesignationCollector { private fun FirRegularClass.collectForNonLocal(): List> { require(!isLocal) - val firProvider = session.firProvider + val firProvider = declarationSiteSession.firProvider var containingClassId = classId.outerClassId val designation = mutableListOf>(this) while (containingClassId != null) { @@ -70,7 +70,7 @@ object DeclarationDesignationCollector { var containingClassLookUp = containingClassForLocal() val designation = mutableListOf>(this) while (containingClassLookUp != null && containingClassLookUp.classId.isLocal) { - val currentClass = containingClassLookUp.toFirRegularClass(session) ?: break + val currentClass = containingClassLookUp.toFirRegularClass(declarationSiteSession) ?: break designation.add(currentClass) containingClassLookUp = currentClass.containingClassForLocal() } @@ -80,4 +80,4 @@ object DeclarationDesignationCollector { fun FirDeclaration.collectDesignation(): FirDeclarationDesignation = - DeclarationDesignationCollector.collectDesignation(this) \ No newline at end of file + DeclarationDesignationCollector.collectDesignation(this) diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirModuleResolveState.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirModuleResolveState.kt index ef550883bc3..f2b675ebe18 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirModuleResolveState.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirModuleResolveState.kt @@ -43,7 +43,7 @@ abstract class FirModuleResolveState { internal inline fun withLock(declaration: D, declarationLockType: DeclarationLockType, action: (D) -> R): R { val originalDeclaration = (declaration as? FirCallableDeclaration<*>)?.unwrapFakeOverrides() ?: declaration - val session = originalDeclaration.session + val session = originalDeclaration.declarationSiteSession return when { originalDeclaration.origin == FirDeclarationOrigin.Source && session is FirIdeSourcesSession @@ -93,4 +93,4 @@ abstract class FirModuleResolveState { } fun FirModuleResolveState.getTowerDataContextUnsafe(element: KtElement): FirTowerDataContext = - getTowerDataContextForElement(element) ?: error("No context for ${element.getElementTextInContext()}") \ No newline at end of file + getTowerDataContextForElement(element) ?: error("No context for ${element.getElementTextInContext()}") diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticRetriever.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticRetriever.kt index 85d62ab56be..40eee22e664 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticRetriever.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticRetriever.kt @@ -31,7 +31,7 @@ internal class SingleNonLocalDeclarationDiagnosticRetriever( collector: FileStructureElementDiagnosticsCollector, lockProvider: LockProvider ): FileStructureElementDiagnosticList { - val sessionHolder = SessionHolderImpl.createWithEmptyScopeSession(firFile.session) + val sessionHolder = SessionHolderImpl.createWithEmptyScopeSession(firFile.declarationSiteSession) val context = lockProvider.withReadLock(firFile) { PersistenceContextCollector.collectContext(sessionHolder, firFile, structureElementDeclaration) } @@ -105,7 +105,7 @@ internal object FileDiagnosticRetriever : FileStructureElementDiagnosticRetrieve firFile: FirFile, components: List ) : FirIdeDiagnosticVisitor( - PersistentCheckerContextFactory.createEmptyPersistenceCheckerContext(SessionHolderImpl.createWithEmptyScopeSession(firFile.session)), + PersistentCheckerContextFactory.createEmptyPersistenceCheckerContext(SessionHolderImpl.createWithEmptyScopeSession(firFile.declarationSiteSession)), components, ) { override fun visitFile(file: FirFile, data: Nothing?) { @@ -118,4 +118,4 @@ internal object FileDiagnosticRetriever : FileStructureElementDiagnosticRetrieve } } } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticsCollector.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticsCollector.kt index fe3f38e6ffd..dbafbd857e2 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticsCollector.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticsCollector.kt @@ -21,11 +21,11 @@ internal class FileStructureElementDiagnosticsCollector private constructor(priv createVisitor: (components: List) -> CheckerRunningDiagnosticCollectorVisitor, ): FileStructureElementDiagnosticList = FirIdeStructureElementDiagnosticsCollector( - firDeclaration.session, + firDeclaration.declarationSiteSession, createVisitor, useExtendedCheckers, ).let { collector -> collector.collectDiagnostics(firDeclaration) FileStructureElementDiagnosticList(collector.result) } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructure.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructure.kt index 93f27b78a2b..00b0ff3ba38 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructure.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructure.kt @@ -30,7 +30,7 @@ internal class FileStructure( private val moduleFileCache: ModuleFileCache, private val collector: FirTowerDataContextCollector ) { - private val firIdeProvider = firFile.session.firIdeProvider + private val firIdeProvider = firFile.declarationSiteSession.firIdeProvider private val structureElements = ConcurrentHashMap() diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructureUtil.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructureUtil.kt index 611493bf1b6..cd2e100caca 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructureUtil.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructureUtil.kt @@ -31,7 +31,7 @@ internal object FileStructureUtil { } else { val classLikeLookupTag = from.containingClass() ?: error("Class name should not be null for non-top-level & non-local declarations, but was null for\n${from.render()}") - val containingClass = classLikeLookupTag.toSymbol(firFile.session)?.fir as FirRegularClass + val containingClass = classLikeLookupTag.toSymbol(firFile.declarationSiteSession)?.fir as FirRegularClass containingClass.declarations as MutableList } declarations.replaceFirst(from, to) @@ -52,4 +52,4 @@ internal object FileStructureUtil { throw e } } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyBodiesCalculator.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyBodiesCalculator.kt index 3ef61efb71e..5fe3054e87f 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyBodiesCalculator.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyBodiesCalculator.kt @@ -30,8 +30,8 @@ internal object FirLazyBodiesCalculator { fun calculateLazyBodiesForFunction(simpleFunction: FirSimpleFunction, designation: List) { if (simpleFunction.body !is FirLazyBlock) return val newFunction = RawFirFragmentForLazyBodiesBuilder.build( - session = simpleFunction.session, - baseScopeProvider = simpleFunction.session.firIdeProvider.kotlinScopeProvider, + session = simpleFunction.declarationSiteSession, + baseScopeProvider = simpleFunction.declarationSiteSession.firIdeProvider.kotlinScopeProvider, designation = designation, declaration = simpleFunction.psi as KtNamedFunction ) as FirSimpleFunction @@ -46,8 +46,8 @@ internal object FirLazyBodiesCalculator { if (secondaryConstructor.body !is FirLazyBlock) return val newFunction = RawFirFragmentForLazyBodiesBuilder.build( - session = secondaryConstructor.session, - baseScopeProvider = secondaryConstructor.session.firIdeProvider.kotlinScopeProvider, + session = secondaryConstructor.declarationSiteSession, + baseScopeProvider = secondaryConstructor.declarationSiteSession.firIdeProvider.kotlinScopeProvider, designation = designation, declaration = secondaryConstructor.psi as KtSecondaryConstructor ) as FirSimpleFunction @@ -61,8 +61,8 @@ internal object FirLazyBodiesCalculator { if (!needCalculatingLazyBodyForProperty(firProperty)) return val newProperty = RawFirFragmentForLazyBodiesBuilder.build( - session = firProperty.session, - baseScopeProvider = firProperty.session.firIdeProvider.kotlinScopeProvider, + session = firProperty.declarationSiteSession, + baseScopeProvider = firProperty.declarationSiteSession.firIdeProvider.kotlinScopeProvider, designation = designation, declaration = firProperty.psi as KtProperty ) as FirProperty diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyDeclarationResolver.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyDeclarationResolver.kt index cb737fff0ee..c6a70e66348 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyDeclarationResolver.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyDeclarationResolver.kt @@ -34,7 +34,7 @@ internal class FirLazyDeclarationResolver( scopeSession: ScopeSession, ) { firFileBuilder.runCustomResolveUnderLock(firFile, moduleFileCache) { - val transformer = FirFileAnnotationsResolveTransformer(firFile.session, scopeSession) + val transformer = FirFileAnnotationsResolveTransformer(firFile.declarationSiteSession, scopeSession) firFile.accept(transformer, ResolutionMode.ContextDependent) } } @@ -58,13 +58,13 @@ internal class FirLazyDeclarationResolver( else -> error("Invalid source of property accessor ${ktDeclaration::class}") } val containingProperty = ktContainingResolvableDeclaration - .findSourceNonLocalFirDeclaration(firFileBuilder, declaration.session.symbolProvider, moduleFileCache) + .findSourceNonLocalFirDeclaration(firFileBuilder, declaration.declarationSiteSession.symbolProvider, moduleFileCache) return lazyResolveDeclaration(containingProperty, moduleFileCache, toPhase, towerDataContextCollector) } val firFile = declaration.getContainingFile() ?: error("FirFile was not found for\n${declaration.render()}") - val provider = firFile.session.firIdeProvider + val provider = firFile.declarationSiteSession.firIdeProvider // Lazy since we want to read the resolve phase inside the lock. Otherwise, we may run the same resolve phase multiple times. See // KT-45121 val fromPhase: FirResolvePhase by lazy(LazyThreadSafetyMode.NONE) { @@ -186,18 +186,18 @@ internal class FirLazyDeclarationResolver( ) = when (this) { FirResolvePhase.CONTRACTS -> FirDesignatedContractsResolveTransformerForIDE( FirDesignation(designation), - containerFirFile.session, + containerFirFile.declarationSiteSession, scopeSession, ) FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE -> FirDesignatedImplicitTypesTransformerForIDE( FirDesignation(designation), - containerFirFile.session, + containerFirFile.declarationSiteSession, scopeSession, towerDataContextCollector, ) FirResolvePhase.BODY_RESOLVE -> FirDesignatedBodyResolveTransformerForIDE( FirDesignation(designation), - containerFirFile.session, + containerFirFile.declarationSiteSession, scopeSession, towerDataContextCollector ) diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/util/contrainingFileUtils.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/util/contrainingFileUtils.kt index f2f83b03526..22281853fb6 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/util/contrainingFileUtils.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/util/contrainingFileUtils.kt @@ -12,11 +12,11 @@ import org.jetbrains.kotlin.fir.declarations.FirFile import org.jetbrains.kotlin.fir.resolve.firProvider fun FirDeclaration.getContainingFile(): FirFile? { - val provider = session.firProvider + val provider = declarationSiteSession.firProvider return when (this) { is FirFile -> this is FirCallableDeclaration<*> -> provider.getFirCallableContainerFile(symbol) is FirClassLikeDeclaration<*> -> provider.getFirClassifierContainerFile(symbol) else -> error("Unsupported declaration ${this::class.java}") } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/AbstractFirSealedInheritorsTest.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/AbstractFirSealedInheritorsTest.kt index 09e14d0cc66..0b25262433e 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/AbstractFirSealedInheritorsTest.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/AbstractFirSealedInheritorsTest.kt @@ -27,7 +27,7 @@ abstract class AbstractFirSealedInheritorsTest : AbstractFirMultiModuleLazyResol val allClasses = firFile.listNestedClasses().closure { it.listNestedClasses() } val inheritorNames = allClasses.flatMap { firClass -> if (firClass.isSealed) { - firClass.getSealedClassInheritors(firFile.session) + firClass.getSealedClassInheritors(firFile.declarationSiteSession) } else { emptyList() } @@ -42,4 +42,4 @@ private fun FirDeclaration.listNestedClasses(): List { is FirRegularClass -> declarations.filterIsInstance() else -> emptyList() } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/AbstractFirContextCollectionTest.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/AbstractFirContextCollectionTest.kt index 2c8a4247d8b..fd3ea2f74e1 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/AbstractFirContextCollectionTest.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/AbstractFirContextCollectionTest.kt @@ -64,7 +64,7 @@ abstract class AbstractFirContextCollectionTest : KotlinLightCodeInsightFixtureT } if (declaration in elementsToCheckContext) { val collectedContext = PersistenceContextCollector.collectContext( - SessionHolderImpl.createWithEmptyScopeSession(declaration.session), + SessionHolderImpl.createWithEmptyScopeSession(declaration.declarationSiteSession), firFile, declaration ) diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/asJava/annotations/annotationsUtils.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/asJava/annotations/annotationsUtils.kt index 611abbdaaaf..a3eda149d1c 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/asJava/annotations/annotationsUtils.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/asJava/annotations/annotationsUtils.kt @@ -49,7 +49,7 @@ internal fun KtAnnotatedSymbol.isHiddenByDeprecation(annotationUseSiteTarget: An annotationCall.classId?.asString() == "kotlin/Deprecated" } ?: return@withFir false - val qualifiedExpression = mapAnnotationParameters(deprecatedAnnotationCall, it.session)["level"] as? FirQualifiedAccessExpression + val qualifiedExpression = mapAnnotationParameters(deprecatedAnnotationCall, it.declarationSiteSession)["level"] as? FirQualifiedAccessExpression ?: return@withFir false val calleeReference = (qualifiedExpression.calleeReference as? FirNamedReference)?.name?.asString() @@ -122,4 +122,4 @@ internal fun KtAnnotatedSymbol.computeAnnotations( } return result -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/asJava/firLightUtils.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/asJava/firLightUtils.kt index 7ee74f4c924..80ea8f50a50 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/asJava/firLightUtils.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/asJava/firLightUtils.kt @@ -60,7 +60,7 @@ internal fun KtTypeAndAnnotations.asPsiType( val type = this.type require(type is KtFirType) require(context is KtFirSymbol<*>) - val session = context.firRef.withFir(phase) { it.session } + val session = context.firRef.withFir(phase) { it.declarationSiteSession } return type.coneType.asPsiType(session, context.firRef.resolveState, TypeMappingMode.DEFAULT, parent) } @@ -72,7 +72,7 @@ internal fun KtNamedClassOrObjectSymbol.typeForClassSymbol(psiElement: PsiElemen } require(types is KtFirType) - val session = firRef.withFir { it.session } + val session = firRef.withFir { it.declarationSiteSession } return types.coneType.asPsiType(session, firRef.resolveState, TypeMappingMode.DEFAULT, psiElement) } @@ -167,7 +167,7 @@ internal fun KtType.mapSupertype( val contextSymbol = classSymbol require(contextSymbol is KtFirSymbol<*>) - val session = contextSymbol.firRef.withFir { it.session } + val session = contextSymbol.firRef.withFir { it.declarationSiteSession } return mapSupertype( psiContext, @@ -297,7 +297,7 @@ internal fun KtType.getTypeNullability(context: KtSymbol, phase: FirResolvePhase if (coneType.classId?.shortClassName?.asString() == SpecialNames.ANONYMOUS) return NullabilityType.NotNull val canonicalSignature = context.firRef.withFir(phase) { - it.session.jvmTypeMapper.mapType(coneType, TypeMappingMode.DEFAULT).descriptor + it.declarationSiteSession.jvmTypeMapper.mapType(coneType, TypeMappingMode.DEFAULT).descriptor } if (canonicalSignature == "[L;") return NullabilityType.NotNull @@ -349,4 +349,4 @@ internal fun KtSimpleConstantValue<*>.createPsiLiteral(parent: PsiElement): PsiE internal inline fun T.applyIf(`if`: Boolean, body: T.() -> T): T = if (`if`) body() else this -internal fun BitSet.copy(): BitSet = clone() as BitSet \ No newline at end of file +internal fun BitSet.copy(): BitSet = clone() as BitSet diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirIdeDeserializedDeclarationSourceProvider.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirIdeDeserializedDeclarationSourceProvider.kt index 93483be1703..c268619fe66 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirIdeDeserializedDeclarationSourceProvider.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirIdeDeserializedDeclarationSourceProvider.kt @@ -160,4 +160,4 @@ fun FirElement.findPsi(session: FirSession): PsiElement? = * Otherwise, behaves the same way as [findPsi] returns exact PSI declaration corresponding to passed [FirDeclaration] */ fun FirDeclaration.findReferencePsi(): PsiElement? = - psi ?: FirIdeDeserializedDeclarationSourceProvider.findPsi(this, (session as FirIdeSession).project) \ No newline at end of file + psi ?: FirIdeDeserializedDeclarationSourceProvider.findPsi(this, (declarationSiteSession as FirIdeSession).project) diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/KtDeclarationAndFirDeclarationEqualityChecker.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/KtDeclarationAndFirDeclarationEqualityChecker.kt index c077e8cda76..6fe019f1178 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/KtDeclarationAndFirDeclarationEqualityChecker.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/KtDeclarationAndFirDeclarationEqualityChecker.kt @@ -30,7 +30,7 @@ object KtDeclarationAndFirDeclarationEqualityChecker { && !isTheSameTypes( psi.receiverTypeReference!!, fir.receiverTypeRef!!, - fir.session, + fir.declarationSiteSession, isVararg = false ) ) { @@ -44,7 +44,7 @@ object KtDeclarationAndFirDeclarationEqualityChecker { if (!isTheSameTypes( candidateParameterType, expectedParameter.returnTypeRef, - fir.session, + fir.declarationSiteSession, isVararg = expectedParameter.isVararg ) ) { diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirScopeProvider.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirScopeProvider.kt index cf31c6eb121..7878c3e3d63 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirScopeProvider.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirScopeProvider.kt @@ -75,7 +75,7 @@ internal class KtFirScopeProvider( memberScopeCache.getOrPut(classSymbol) { val firScope = classSymbol.withFirForScope { fir -> - val firSession = fir.session + val firSession = fir.declarationSiteSession fir.unsubstitutedScope( firSession, ScopeSession(), diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirSymbolDeclarationOverridesProvider.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirSymbolDeclarationOverridesProvider.kt index b84060b7919..521643c71bc 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirSymbolDeclarationOverridesProvider.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirSymbolDeclarationOverridesProvider.kt @@ -105,7 +105,7 @@ internal class KtFirSymbolDeclarationOverridesProvider( containingDeclaration.firRef.withFir(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) { firContainer -> callableSymbol.firRef.withFirUnsafe { firCallableDeclaration -> val firTypeScope = firContainer.unsubstitutedScope( - firContainer.session, + firContainer.declarationSiteSession, ScopeSession(), withForcedTypeCalculator = false ) diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirSymbolDeclarationRendererProvider.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirSymbolDeclarationRendererProvider.kt index e7782d8489f..b88de0c5b29 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirSymbolDeclarationRendererProvider.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirSymbolDeclarationRendererProvider.kt @@ -41,7 +41,7 @@ internal class KtFirSymbolDeclarationRendererProvider( return (containingSymbol ?: symbol).firRef.withFir(phaseNeeded) { fir -> val containingFir = containingSymbol?.firRef?.withFirUnsafe { it } - FirIdeRenderer.render(fir, containingFir, options, fir.session) + FirIdeRenderer.render(fir, containingFir, options, fir.declarationSiteSession) } } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirAnonymousFunctionSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirAnonymousFunctionSymbol.kt index ad811adb2d7..98fcf77fa86 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirAnonymousFunctionSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirAnonymousFunctionSymbol.kt @@ -28,7 +28,7 @@ internal class KtFirAnonymousFunctionSymbol( ) : KtAnonymousFunctionSymbol(), KtFirSymbol { private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val annotatedType: KtTypeAndAnnotations by cached { firRef.returnTypeAndAnnotations(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE, builder) @@ -49,4 +49,4 @@ internal class KtFirAnonymousFunctionSymbol( KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it } error("Could not create a pointer for anonymous function from library") } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirAnonymousObjectSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirAnonymousObjectSymbol.kt index a6c2f4e1dce..ec446ddfef5 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirAnonymousObjectSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirAnonymousObjectSymbol.kt @@ -35,7 +35,7 @@ internal class KtFirAnonymousObjectSymbol( ) : KtAnonymousObjectSymbol(), KtFirSymbol { private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val annotations: List by cached { firRef.toAnnotationsList() } override fun containsAnnotation(classId: ClassId): Boolean = firRef.containsAnnotation(classId) @@ -48,4 +48,4 @@ internal class KtFirAnonymousObjectSymbol( override fun createPointer(): KtSymbolPointer = KtPsiBasedSymbolPointer.createForSymbolFromSource(this) ?: throw CanNotCreateSymbolPointerForLocalLibraryDeclarationException("Cannot create pointer for KtFirAnonymousObjectSymbol") -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirConstructorSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirConstructorSymbol.kt index e5e7ae3b0ab..e4500d38ad2 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirConstructorSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirConstructorSymbol.kt @@ -42,7 +42,7 @@ internal class KtFirConstructorSymbol( ) : KtConstructorSymbol(), KtFirSymbol { private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val annotatedType: KtTypeAndAnnotations by cached { firRef.returnTypeAndAnnotations(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE, builder) diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirEnumEntrySymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirEnumEntrySymbol.kt index 5fe62c73147..bbf24d94829 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirEnumEntrySymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirEnumEntrySymbol.kt @@ -34,7 +34,7 @@ internal class KtFirEnumEntrySymbol( private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val name: Name get() = firRef.withFir { it.name } override val annotatedType: KtTypeAndAnnotations by cached { diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirFileSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirFileSymbol.kt index 8d4442d07bc..aa1a2ba7ac2 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirFileSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirFileSymbol.kt @@ -28,7 +28,7 @@ internal class KtFirFileSymbol( override val token: ValidityToken, ) : KtFileSymbol(), KtSymbolWithDeclarations, KtFirSymbol { override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override fun createPointer(): KtSymbolPointer { KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it } @@ -38,4 +38,4 @@ internal class KtFirFileSymbol( override val annotations: List by cached { firRef.toAnnotationsList() } override fun containsAnnotation(classId: ClassId): Boolean = firRef.containsAnnotation(classId) override val annotationClassIds: Collection by cached { firRef.getAnnotationClassIds() } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirFunctionSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirFunctionSymbol.kt index 80e2b084999..cd38cb08137 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirFunctionSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirFunctionSymbol.kt @@ -43,7 +43,7 @@ internal class KtFirFunctionSymbol( ) : KtFunctionSymbol(), KtFirSymbol { private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val name: Name get() = firRef.withFir { it.name } override val annotatedType: KtTypeAndAnnotations by cached { firRef.returnTypeAndAnnotations(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE, builder) diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirJavaFieldSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirJavaFieldSymbol.kt index 8f3de84d02f..b40a6385f3f 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirJavaFieldSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirJavaFieldSymbol.kt @@ -32,7 +32,7 @@ internal class KtFirJavaFieldSymbol( ) : KtJavaFieldSymbol(), KtFirSymbol { private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val annotatedType: KtTypeAndAnnotations by cached { firRef.returnTypeAndAnnotations(FirResolvePhase.TYPES, builder) @@ -49,4 +49,4 @@ internal class KtFirJavaFieldSymbol( override fun createPointer(): KtSymbolPointer { TODO("Creating pointers for java fields is not supported yet") } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirKotlinPropertySymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirKotlinPropertySymbol.kt index d487e84fc8e..270c5a6c8f0 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirKotlinPropertySymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirKotlinPropertySymbol.kt @@ -51,7 +51,7 @@ internal class KtFirKotlinPropertySymbol( private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val isVal: Boolean get() = firRef.withFir { it.isVal } override val name: Name get() = firRef.withFir { it.name } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirLocalVariableSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirLocalVariableSymbol.kt index 3facbf620a3..ca6c27028a7 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirLocalVariableSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirLocalVariableSymbol.kt @@ -36,7 +36,7 @@ internal class KtFirLocalVariableSymbol( private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val isVal: Boolean get() = firRef.withFir { it.isVal } override val name: Name get() = firRef.withFir { it.name } @@ -49,4 +49,4 @@ internal class KtFirLocalVariableSymbol( KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it } throw CanNotCreateSymbolPointerForLocalLibraryDeclarationException(name.asString()) } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirNamedClassOrObjectSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirNamedClassOrObjectSymbol.kt index 9643905ae38..6fd1687dd1c 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirNamedClassOrObjectSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirNamedClassOrObjectSymbol.kt @@ -38,7 +38,7 @@ internal class KtFirNamedClassOrObjectSymbol( ) : KtNamedClassOrObjectSymbol(), KtFirSymbol { private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val name: Name get() = firRef.withFir { it.name } override val classIdIfNonLocal: ClassId? get() = firRef.withFir { fir -> @@ -101,4 +101,4 @@ internal class KtFirNamedClassOrObjectSymbol( } return KtFirClassOrObjectInLibrarySymbolPointer(classIdIfNonLocal!!) } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirPropertyGetterSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirPropertyGetterSymbol.kt index 4dc2cc39f7e..de8721e605f 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirPropertyGetterSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirPropertyGetterSymbol.kt @@ -39,7 +39,7 @@ internal class KtFirPropertyGetterSymbol( private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val isDefault: Boolean get() = firRef.withFir { it is FirDefaultPropertyAccessor } override val isInline: Boolean get() = firRef.withFir { it.isInline } @@ -63,4 +63,4 @@ internal class KtFirPropertyGetterSymbol( KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it } TODO("Creating pointers for getters from library is not supported yet") } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirPropertySetterSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirPropertySetterSymbol.kt index a65ad303526..96e9f5f2250 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirPropertySetterSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirPropertySetterSymbol.kt @@ -40,7 +40,7 @@ internal class KtFirPropertySetterSymbol( private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val isDefault: Boolean get() = firRef.withFir { it is FirDefaultPropertyAccessor } override val isInline: Boolean get() = firRef.withFir { it.isInline } @@ -70,4 +70,4 @@ internal class KtFirPropertySetterSymbol( KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it } TODO("Creating pointers for setters from library is not supported yet") } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirSyntheticJavaPropertySymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirSyntheticJavaPropertySymbol.kt index 4986b140638..bccd5f4d073 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirSyntheticJavaPropertySymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirSyntheticJavaPropertySymbol.kt @@ -44,7 +44,7 @@ internal class KtFirSyntheticJavaPropertySymbol( ) : KtSyntheticJavaPropertySymbol(), KtFirSymbol { private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val isVal: Boolean get() = firRef.withFir { it.isVal } override val name: Name get() = firRef.withFir { it.name } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirTypeAliasSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirTypeAliasSymbol.kt index 6c91eb0fd25..b846ecbaffc 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirTypeAliasSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirTypeAliasSymbol.kt @@ -23,7 +23,7 @@ internal class KtFirTypeAliasSymbol( override val token: ValidityToken ) : KtTypeAliasSymbol(), KtFirSymbol { override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val name: Name get() = firRef.withFir { it.name } override val classIdIfNonLocal: ClassId get() = firRef.withFir { it.symbol.classId } @@ -31,4 +31,4 @@ internal class KtFirTypeAliasSymbol( KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it } TODO("Creating symbols for library typealiases is not supported yet") } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirTypeParameterSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirTypeParameterSymbol.kt index 2e84e4b9119..ba6faa0fbba 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirTypeParameterSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirTypeParameterSymbol.kt @@ -29,7 +29,7 @@ internal class KtFirTypeParameterSymbol( ) : KtTypeParameterSymbol(), KtFirSymbol { private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val name: Name get() = firRef.withFir { it.name } @@ -44,4 +44,4 @@ internal class KtFirTypeParameterSymbol( KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it } TODO("Creating symbols for library type parameters is not supported yet") } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirValueParameterSymbol.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirValueParameterSymbol.kt index 96ad5a06c7f..0172d27b492 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirValueParameterSymbol.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/KtFirValueParameterSymbol.kt @@ -34,7 +34,7 @@ internal class KtFirValueParameterSymbol( ) : KtValueParameterSymbol(), KtFirSymbol { private val builder by weakRef(_builder) override val firRef = firRef(fir, resolveState) - override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) } + override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.declarationSiteSession) } override val name: Name get() = firRef.withFir { it.name } override val isVararg: Boolean get() = firRef.withFir { it.isVararg } @@ -52,4 +52,4 @@ internal class KtFirValueParameterSymbol( KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it } TODO("Creating pointers for functions parameters from library is not supported yet") } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/KtFirAnnotationCall.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/KtFirAnnotationCall.kt index 8b9488a9fe8..300f6eefe71 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/KtFirAnnotationCall.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/KtFirAnnotationCall.kt @@ -29,17 +29,17 @@ internal class KtFirAnnotationCall( override val token: ValidityToken get() = containingDeclaration.token override val psi: KtCallElement? by containingDeclaration.withFirAndCache { fir -> - fir.findPsi(fir.session) as? KtCallElement + fir.findPsi(fir.declarationSiteSession) as? KtCallElement } override val classId: ClassId? by containingDeclaration.withFirAndCache(AnnotationPhases.PHASE_FOR_ANNOTATION_CLASS_ID) { fir -> - annotationCallRef.getClassId(fir.session) + annotationCallRef.getClassId(fir.declarationSiteSession) } override val useSiteTarget: AnnotationUseSiteTarget? get() = annotationCallRef.useSiteTarget override val arguments: List by containingDeclaration.withFirAndCache(FirResolvePhase.TYPES) { fir -> - mapAnnotationParameters(annotationCallRef, fir.session).map { (name, expression) -> + mapAnnotationParameters(annotationCallRef, fir.declarationSiteSession).map { (name, expression) -> KtNamedConstantValue(name, expression.convertConstantExpression()) } } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/firAnnotationUtils.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/firAnnotationUtils.kt index 2e2c1050bfc..84d3aa0367a 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/firAnnotationUtils.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/firAnnotationUtils.kt @@ -25,15 +25,15 @@ internal fun FirRefWithValidityCheck.toAnnotationsList( internal fun FirRefWithValidityCheck.containsAnnotation(classId: ClassId): Boolean = withFir(AnnotationPhases.PHASE_FOR_ANNOTATION_CLASS_ID) { fir -> - fir.annotations.any { it.getClassId(fir.session) == classId } + fir.annotations.any { it.getClassId(fir.declarationSiteSession) == classId } } internal fun FirRefWithValidityCheck.getAnnotationClassIds(): Collection = withFir(AnnotationPhases.PHASE_FOR_ANNOTATION_CLASS_ID) { fir -> - fir.annotations.mapNotNull { it.getClassId(fir.session) } + fir.annotations.mapNotNull { it.getClassId(fir.declarationSiteSession) } } internal object AnnotationPhases { val PHASE_FOR_ANNOTATION_CLASS_ID = FirResolvePhase.TYPES -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/KtFirMemberSymbolPointer.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/KtFirMemberSymbolPointer.kt index 42a4910fb1c..a1da6c4c361 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/KtFirMemberSymbolPointer.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/KtFirMemberSymbolPointer.kt @@ -29,7 +29,7 @@ internal abstract class KtFirMemberSymbolPointer( ScopeSession(), withForcedTypeCalculator = false ) - return analysisSession.chooseCandidateAndCreateSymbol(scope, owner.session) + return analysisSession.chooseCandidateAndCreateSymbol(scope, owner.declarationSiteSession) } protected abstract fun KtFirAnalysisSession.chooseCandidateAndCreateSymbol( diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/KtFirTopLevelCallableSymbolPointer.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/KtFirTopLevelCallableSymbolPointer.kt index 268f020ca7f..65008bea112 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/KtFirTopLevelCallableSymbolPointer.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/KtFirTopLevelCallableSymbolPointer.kt @@ -21,7 +21,7 @@ internal abstract class KtTopLevelCallableSymbolPointer( require(analysisSession is KtFirAnalysisSession) val candidates = analysisSession.getCallableSymbols(callableId) if (candidates.isEmpty()) return null - val session = candidates.first().fir.session + val session = candidates.first().fir.declarationSiteSession return analysisSession.chooseCandidateAndCreateSymbol(candidates, session) } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/pointerUtils.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/pointerUtils.kt index d573b4ef34b..ce4fffb759f 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/pointerUtils.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/pointers/pointerUtils.kt @@ -46,7 +46,7 @@ internal inline fun Collection } internal fun FirDeclaration.createSignature(): IdSignature { - val signatureComposer = session.ideSessionComponents.signatureComposer + val signatureComposer = declarationSiteSession.ideSessionComponents.signatureComposer return signatureComposer.composeSignature(this) ?: error("Could not compose signature for ${this.renderWithType(FirRenderer.RenderMode.WithResolvePhases)}, looks like it is private or local") } diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/fir/AbstractKtDeclarationAndFirDeclarationEqualityChecker.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/fir/AbstractKtDeclarationAndFirDeclarationEqualityChecker.kt index 1272b8243f4..462840cf06c 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/fir/AbstractKtDeclarationAndFirDeclarationEqualityChecker.kt +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/fir/AbstractKtDeclarationAndFirDeclarationEqualityChecker.kt @@ -26,11 +26,11 @@ abstract class AbstractKtDeclarationAndFirDeclarationEqualityChecker : KotlinLig if (!KtDeclarationAndFirDeclarationEqualityChecker.representsTheSameDeclaration(ktFunction, firFunction)) { throw FileComparisonFailure( /* message= */ null, - KtDeclarationAndFirDeclarationEqualityChecker.renderPsi(ktFunction, firFunction.session), + KtDeclarationAndFirDeclarationEqualityChecker.renderPsi(ktFunction, firFunction.declarationSiteSession), KtDeclarationAndFirDeclarationEqualityChecker.renderFir(firFunction), /* expectedFilePath= */ null ) } } } -} \ No newline at end of file +} diff --git a/plugins/fir/fir-plugin-prototype/src/org/jetbrains/kotlin/fir/plugin/generators/AllOpenNestedClassGenerator.kt b/plugins/fir/fir-plugin-prototype/src/org/jetbrains/kotlin/fir/plugin/generators/AllOpenNestedClassGenerator.kt index 15403983c82..db358cdddbe 100644 --- a/plugins/fir/fir-plugin-prototype/src/org/jetbrains/kotlin/fir/plugin/generators/AllOpenNestedClassGenerator.kt +++ b/plugins/fir/fir-plugin-prototype/src/org/jetbrains/kotlin/fir/plugin/generators/AllOpenNestedClassGenerator.kt @@ -60,7 +60,7 @@ class AllOpenNestedClassGenerator(session: FirSession) : FirDeclarationGeneratio val classId = klass.symbol.classId val constructor = buildConstructor { - session = klass.session + session = klass.declarationSiteSession resolvePhase = FirResolvePhase.ANALYZED_DEPENDENCIES origin = FirDeclarationOrigin.Plugin(key) returnTypeRef = buildResolvedTypeRef { @@ -75,7 +75,7 @@ class AllOpenNestedClassGenerator(session: FirSession) : FirDeclarationGeneratio } val function = buildSimpleFunction { - session = klass.session + session = klass.declarationSiteSession resolvePhase = FirResolvePhase.ANALYZED_DEPENDENCIES origin = FirDeclarationOrigin.Plugin(key) returnTypeRef = session.builtinTypes.intType diff --git a/plugins/fir/fir-plugin-prototype/src/org/jetbrains/kotlin/fir/plugin/generators/AllOpenTopLevelDeclarationsGenerator.kt b/plugins/fir/fir-plugin-prototype/src/org/jetbrains/kotlin/fir/plugin/generators/AllOpenTopLevelDeclarationsGenerator.kt index e84e0716337..66f2bfd3118 100644 --- a/plugins/fir/fir-plugin-prototype/src/org/jetbrains/kotlin/fir/plugin/generators/AllOpenTopLevelDeclarationsGenerator.kt +++ b/plugins/fir/fir-plugin-prototype/src/org/jetbrains/kotlin/fir/plugin/generators/AllOpenTopLevelDeclarationsGenerator.kt @@ -52,7 +52,7 @@ class AllOpenTopLevelDeclarationsGenerator(session: FirSession) : FirDeclaration override fun generateMembersForGeneratedClass(generatedClass: GeneratedClass): List { val klass = generatedClass.klass val function = buildSimpleFunction { - session = klass.session + session = klass.declarationSiteSession resolvePhase = FirResolvePhase.ANALYZED_DEPENDENCIES origin = FirDeclarationOrigin.Plugin(key) returnTypeRef = session.builtinTypes.intType