FIR: Minor. Unbound FirTowerResolverSession from FirLocalScope
This commit is contained in:
+7
-8
@@ -24,7 +24,6 @@ import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.firUnsafe
|
|||||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.ProcessorAction
|
import org.jetbrains.kotlin.fir.scopes.ProcessorAction
|
||||||
import org.jetbrains.kotlin.fir.scopes.impl.FirCompositeScope
|
import org.jetbrains.kotlin.fir.scopes.impl.FirCompositeScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.impl.FirLocalScope
|
|
||||||
import org.jetbrains.kotlin.fir.scopes.impl.FirStaticScope
|
import org.jetbrains.kotlin.fir.scopes.impl.FirStaticScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||||
@@ -58,7 +57,7 @@ class FirTowerResolverSession internal constructor(
|
|||||||
this.implicitReceiversUsableAsValues = implicitReceiversUsableAsValues
|
this.implicitReceiversUsableAsValues = implicitReceiversUsableAsValues
|
||||||
}
|
}
|
||||||
|
|
||||||
private val localScopes: List<FirLocalScope> = components.localScopes.asReversed()
|
private val localScopes: List<FirScope> = components.localScopes.asReversed()
|
||||||
|
|
||||||
private val topLevelScopes: List<FirScope> =
|
private val topLevelScopes: List<FirScope> =
|
||||||
if (components.typeParametersScopes.isEmpty())
|
if (components.typeParametersScopes.isEmpty())
|
||||||
@@ -229,7 +228,7 @@ class FirTowerResolverSession internal constructor(
|
|||||||
info: CallInfo
|
info: CallInfo
|
||||||
) {
|
) {
|
||||||
processExtensionsThatHideMembers(info, explicitReceiverValue = null)
|
processExtensionsThatHideMembers(info, explicitReceiverValue = null)
|
||||||
val nonEmptyLocalScopes = mutableListOf<FirLocalScope>()
|
val nonEmptyLocalScopes = mutableListOf<FirScope>()
|
||||||
processLocalScopesWithNoReceiver(info, nonEmptyLocalScopes)
|
processLocalScopesWithNoReceiver(info, nonEmptyLocalScopes)
|
||||||
|
|
||||||
val emptyTopLevelScopes = mutableSetOf<FirScope>()
|
val emptyTopLevelScopes = mutableSetOf<FirScope>()
|
||||||
@@ -282,7 +281,7 @@ class FirTowerResolverSession internal constructor(
|
|||||||
|
|
||||||
private suspend fun processLocalScopesWithNoReceiver(
|
private suspend fun processLocalScopesWithNoReceiver(
|
||||||
info: CallInfo,
|
info: CallInfo,
|
||||||
nonEmptyLocalScopes: MutableList<FirLocalScope>
|
nonEmptyLocalScopes: MutableList<FirScope>
|
||||||
) {
|
) {
|
||||||
for ((index, localScope) in localScopes.withIndex()) {
|
for ((index, localScope) in localScopes.withIndex()) {
|
||||||
val result = processLevel(
|
val result = processLevel(
|
||||||
@@ -296,7 +295,7 @@ class FirTowerResolverSession internal constructor(
|
|||||||
|
|
||||||
private suspend fun processImplicitReceiversWithNoExplicit(
|
private suspend fun processImplicitReceiversWithNoExplicit(
|
||||||
info: CallInfo,
|
info: CallInfo,
|
||||||
nonEmptyLocalScopes: MutableList<FirLocalScope>,
|
nonEmptyLocalScopes: MutableList<FirScope>,
|
||||||
emptyTopLevelScopes: MutableSet<FirScope>
|
emptyTopLevelScopes: MutableSet<FirScope>
|
||||||
) {
|
) {
|
||||||
val implicitReceiverValuesWithEmptyScopes = mutableSetOf<ImplicitReceiverValue<*>>()
|
val implicitReceiverValuesWithEmptyScopes = mutableSetOf<ImplicitReceiverValue<*>>()
|
||||||
@@ -332,7 +331,7 @@ class FirTowerResolverSession internal constructor(
|
|||||||
info: CallInfo,
|
info: CallInfo,
|
||||||
parentGroup: TowerGroup,
|
parentGroup: TowerGroup,
|
||||||
implicitReceiverValuesWithEmptyScopes: MutableSet<ImplicitReceiverValue<*>>,
|
implicitReceiverValuesWithEmptyScopes: MutableSet<ImplicitReceiverValue<*>>,
|
||||||
nonEmptyLocalScopes: List<FirLocalScope>,
|
nonEmptyLocalScopes: List<FirScope>,
|
||||||
emptyTopLevelScopes: MutableSet<FirScope>
|
emptyTopLevelScopes: MutableSet<FirScope>
|
||||||
) {
|
) {
|
||||||
val implicitResult = processLevel(
|
val implicitResult = processLevel(
|
||||||
@@ -400,7 +399,7 @@ class FirTowerResolverSession internal constructor(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val nonEmptyLocalScopes = mutableListOf<FirLocalScope>()
|
val nonEmptyLocalScopes = mutableListOf<FirScope>()
|
||||||
for ((index, localScope) in localScopes.withIndex()) {
|
for ((index, localScope) in localScopes.withIndex()) {
|
||||||
if (processScopeForExplicitReceiver(
|
if (processScopeForExplicitReceiver(
|
||||||
localScope,
|
localScope,
|
||||||
@@ -459,7 +458,7 @@ class FirTowerResolverSession internal constructor(
|
|||||||
explicitReceiverValue: ExpressionReceiverValue,
|
explicitReceiverValue: ExpressionReceiverValue,
|
||||||
info: CallInfo,
|
info: CallInfo,
|
||||||
depth: Int,
|
depth: Int,
|
||||||
nonEmptyLocalScopes: MutableList<FirLocalScope>
|
nonEmptyLocalScopes: MutableList<FirScope>
|
||||||
) {
|
) {
|
||||||
// NB: companions are processed via implicitReceiverValues!
|
// NB: companions are processed via implicitReceiverValues!
|
||||||
val parentGroup = TowerGroup.Implicit(depth)
|
val parentGroup = TowerGroup.Implicit(depth)
|
||||||
|
|||||||
Reference in New Issue
Block a user