FIR: Rework overridden members processing in FirTypeScope

Now, FirTypeScope returns only direct overridden and a base scope
where a client might look for deeper overridden

It's necessary to make the API fast and simple
when only direct overridden are needed

At the same time, while this API looks a bit complicated for most of the clients
there are simple extension helpers that obtain just the direct or all overridden
This commit is contained in:
Denis Zharkov
2020-08-20 10:43:29 +03:00
parent 8ce9b2d061
commit 7f3f0faa1a
14 changed files with 252 additions and 205 deletions
@@ -85,20 +85,21 @@ class JavaClassMembersEnhancementScope(
}
}
override fun processOverriddenFunctionsWithDepth(
override fun processDirectOverriddenFunctionsWithBaseScope(
functionSymbol: FirFunctionSymbol<*>,
processor: (FirFunctionSymbol<*>, Int) -> ProcessorAction
): ProcessorAction = doProcessOverriddenCallables(
functionSymbol, processor, overriddenFunctions, useSiteMemberScope,
FirTypeScope::processOverriddenFunctionsWithDepth
)
processor: (FirFunctionSymbol<*>, FirTypeScope) -> ProcessorAction
): ProcessorAction =
doProcessDirectOverriddenCallables(
functionSymbol, processor, overriddenFunctions, useSiteMemberScope,
FirTypeScope::processDirectOverriddenFunctionsWithBaseScope
)
override fun processOverriddenPropertiesWithDepth(
override fun processDirectOverriddenPropertiesWithBaseScope(
propertySymbol: FirPropertySymbol,
processor: (FirPropertySymbol, Int) -> ProcessorAction
): ProcessorAction = doProcessOverriddenCallables(
processor: (FirPropertySymbol, FirTypeScope) -> ProcessorAction
): ProcessorAction = doProcessDirectOverriddenCallables(
propertySymbol, processor, overriddenProperties, useSiteMemberScope,
FirTypeScope::processOverriddenPropertiesWithDepth
FirTypeScope::processDirectOverriddenPropertiesWithBaseScope
)
override fun getCallableNames(): Set<Name> {