K2 IC: add lookups of candidates on tower level processing

Allow recording lookup to symbols from supertypes, required at least
for CRI.

partially fixes #KTIJ-29026
This commit is contained in:
Ilya Chernikov
2024-03-07 15:29:06 +01:00
committed by Space Team
parent 39b05a0a1c
commit 4fafa4b6e9
15 changed files with 65 additions and 24 deletions
@@ -454,14 +454,16 @@ internal class ScopeTowerLevel(
info: CallInfo,
processor: TowerScopeLevelProcessor<FirFunctionSymbol<*>>
): ProcessResult {
val lookupTracker = session.lookupTracker
var empty = true
session.lookupTracker?.recordCallLookup(info, scope.scopeOwnerLookupNames)
lookupTracker?.recordCallLookup(info, scope.scopeOwnerLookupNames)
scope.processFunctionsAndConstructorsByName(
info,
session,
bodyResolveComponents,
constructorFilter
) { candidate ->
lookupTracker?.recordCallableCandidateAsLookup(candidate, info.callSite.source, info.containingFile.source)
empty = false
consumeCallableCandidate(candidate, info, processor)
}
@@ -472,9 +474,11 @@ internal class ScopeTowerLevel(
info: CallInfo,
processor: TowerScopeLevelProcessor<FirVariableSymbol<*>>
): ProcessResult {
val lookupTracker = session.lookupTracker
var empty = true
session.lookupTracker?.recordCallLookup(info, scope.scopeOwnerLookupNames)
lookupTracker?.recordCallLookup(info, scope.scopeOwnerLookupNames)
scope.processPropertiesByName(info.name) { candidate ->
lookupTracker?.recordCallableCandidateAsLookup(candidate, info.callSite.source, info.containingFile.source)
empty = false
consumeCallableCandidate(candidate, info, processor)
}