FIR IDE/LC: introduce/use delegated member scope

This commit is contained in:
Jinseong Jeon
2021-10-20 16:20:14 -07:00
committed by Ilya Kirillov
parent 700f8ac287
commit 3f2c86afb8
18 changed files with 271 additions and 20 deletions
@@ -204,11 +204,8 @@ internal class FirLightClassForSymbol(
}
analyzeWithSymbolAsContext(classOrObjectSymbol) {
// NB: delegated members are not available at _declared_ member scope.
// Thus, use member scope to get "all" callable members, including members from (interface) supertypes,
// and accept fake overrides with delegated origin to create delegate methods.
classOrObjectSymbol.getMemberScope().getCallableSymbols().forEach { functionSymbol ->
if (functionSymbol is KtFunctionSymbol && functionSymbol.origin == KtSymbolOrigin.DELEGATED) {
classOrObjectSymbol.getDelegatedMemberScope().getCallableSymbols().forEach { functionSymbol ->
if (functionSymbol is KtFunctionSymbol) {
createDelegateMethod(functionSymbol)
}
}