FIR: Minor. Clarify some names at FirTypeIntersectionScopeContext
This commit is contained in:
+1
-1
@@ -96,7 +96,7 @@ abstract class AbstractFirUseSiteMemberScope(
|
||||
|
||||
private fun getFunctionsFromSupertypesByName(name: Name): List<ResultOfIntersection<FirNamedFunctionSymbol>> {
|
||||
return functionsFromSupertypes.getOrPut(name) {
|
||||
supertypeScopeContext.collectCallables(name, FirScope::processFunctionsByName)
|
||||
supertypeScopeContext.collectIntersectionResultsForCallables(name, FirScope::processFunctionsByName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ class FirClassUseSiteMemberScope(
|
||||
}
|
||||
|
||||
val fields = mutableListOf<FirFieldSymbol>()
|
||||
val properties = supertypeScopeContext.collectCallables<FirPropertySymbol>(name) { propertyName, processor ->
|
||||
val properties = supertypeScopeContext.collectIntersectionResultsForCallables<FirPropertySymbol>(name) { propertyName, processor ->
|
||||
processPropertiesByName(propertyName) {
|
||||
when (it) {
|
||||
is FirPropertySymbol -> processor(it)
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ class FirTypeIntersectionScope private constructor(
|
||||
return
|
||||
}
|
||||
|
||||
val callablesWithOverridden = intersectionContext.collectCallables(name, processCallables)
|
||||
val callablesWithOverridden = intersectionContext.collectIntersectionResultsForCallables(name, processCallables)
|
||||
|
||||
if (callablesWithOverridden.isEmpty()) {
|
||||
absentNames.add(name)
|
||||
|
||||
+11
-7
@@ -10,7 +10,9 @@ import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.caches.*
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
||||
import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isExpect
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.modality
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.visibility
|
||||
@@ -20,7 +22,9 @@ import org.jetbrains.kotlin.fir.scopes.*
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirIntersectionOverrideStorage.ContextForIntersectionOverrideConstruction
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirTypeIntersectionScopeContext.ResultOfIntersection
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.fir.types.ConeSimpleKotlinType
|
||||
import org.jetbrains.kotlin.fir.types.classId
|
||||
import org.jetbrains.kotlin.name.CallableId
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
@@ -109,11 +113,11 @@ class FirTypeIntersectionScopeContext(
|
||||
}
|
||||
|
||||
fun collectFunctions(name: Name): List<ResultOfIntersection<FirNamedFunctionSymbol>> {
|
||||
return collectCallables(name, FirScope::processFunctionsByName)
|
||||
return collectIntersectionResultsForCallables(name, FirScope::processFunctionsByName)
|
||||
}
|
||||
|
||||
@OptIn(PrivateForInline::class)
|
||||
inline fun <D : FirCallableSymbol<*>> collectMembersByScope(
|
||||
inline fun <D : FirCallableSymbol<*>> collectMembersGroupedByScope(
|
||||
name: Name,
|
||||
processCallables: FirScope.(Name, (D) -> Unit) -> Unit
|
||||
): MembersByScope<D> {
|
||||
@@ -132,14 +136,14 @@ class FirTypeIntersectionScopeContext(
|
||||
}
|
||||
|
||||
@OptIn(PrivateForInline::class)
|
||||
inline fun <D : FirCallableSymbol<*>> collectCallables(
|
||||
inline fun <D : FirCallableSymbol<*>> collectIntersectionResultsForCallables(
|
||||
name: Name,
|
||||
processCallables: FirScope.(Name, (D) -> Unit) -> Unit
|
||||
): List<ResultOfIntersection<D>> {
|
||||
return collectCallablesImpl(collectMembersByScope(name, processCallables))
|
||||
return convertGroupedCallablesToIntersectionResults(collectMembersGroupedByScope(name, processCallables))
|
||||
}
|
||||
|
||||
fun <D : FirCallableSymbol<*>> collectCallablesImpl(
|
||||
fun <D : FirCallableSymbol<*>> convertGroupedCallablesToIntersectionResults(
|
||||
membersByScope: List<Pair<FirTypeScope, List<D>>>
|
||||
): List<ResultOfIntersection<D>> {
|
||||
if (membersByScope.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user