FirAbstractImportingScope: minor simplification
This commit is contained in:
+3
-12
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.fir.resolve.toSymbol
|
|||||||
import org.jetbrains.kotlin.fir.resolve.transformers.ensureResolvedForCalls
|
import org.jetbrains.kotlin.fir.resolve.transformers.ensureResolvedForCalls
|
||||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
||||||
import org.jetbrains.kotlin.fir.symbols.CallableId
|
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||||
import org.jetbrains.kotlin.name.ClassId
|
import org.jetbrains.kotlin.name.ClassId
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
@@ -60,24 +59,16 @@ abstract class FirAbstractImportingScope(
|
|||||||
token: TowerScopeLevel.Token<T>,
|
token: TowerScopeLevel.Token<T>,
|
||||||
processor: (FirCallableSymbol<*>) -> Unit
|
processor: (FirCallableSymbol<*>) -> Unit
|
||||||
) {
|
) {
|
||||||
val callableId = CallableId(import.packageFqName, import.relativeClassName, name)
|
|
||||||
|
|
||||||
val classId = import.resolvedClassId
|
val classId = import.resolvedClassId
|
||||||
if (classId != null) {
|
if (classId != null) {
|
||||||
val scope = getStaticsScope(classId) ?: return
|
val scope = getStaticsScope(classId) ?: return
|
||||||
|
|
||||||
when (token) {
|
when (token) {
|
||||||
TowerScopeLevel.Token.Functions -> scope.processFunctionsByName(
|
TowerScopeLevel.Token.Functions -> scope.processFunctionsByName(name, processor)
|
||||||
callableId.callableName,
|
TowerScopeLevel.Token.Properties -> scope.processPropertiesByName(name, processor)
|
||||||
processor
|
|
||||||
)
|
|
||||||
TowerScopeLevel.Token.Properties -> scope.processPropertiesByName(
|
|
||||||
callableId.callableName,
|
|
||||||
processor
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
} else if (name.isSpecial || name.identifier.isNotEmpty()) {
|
} else if (name.isSpecial || name.identifier.isNotEmpty()) {
|
||||||
val symbols = provider.getTopLevelCallableSymbols(callableId.packageName, callableId.callableName)
|
val symbols = provider.getTopLevelCallableSymbols(import.packageFqName, name)
|
||||||
if (symbols.isEmpty()) {
|
if (symbols.isEmpty()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user