From 26982d1b488745676319fa73c891fc407d32ea62 Mon Sep 17 00:00:00 2001 From: Pavel Kirpichenkov Date: Wed, 2 Sep 2020 12:23:35 +0300 Subject: [PATCH] [FIR-IDE] Use delegating KtScope for type param scope --- .../frontend/api/fir/components/KtFirScopeProvider.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirScopeProvider.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirScopeProvider.kt index a523c8fa6ff..f438497a37a 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirScopeProvider.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirScopeProvider.kt @@ -132,9 +132,9 @@ internal class KtFirScopeProvider( @OptIn(ExperimentalStdlibApi::class) val allKtScopes = buildList { - implicitReceiverScopes.mapNotNullTo(this, ::convertToKtScope) - nonLocalScopes.mapNotNullTo(this, ::convertToKtScope) - firLocalScopes.mapNotNullTo(this, ::convertToKtScope) + implicitReceiverScopes.mapTo(this, ::convertToKtScope) + nonLocalScopes.mapTo(this, ::convertToKtScope) + firLocalScopes.mapTo(this, ::convertToKtScope) } KtScopeContext(getCompositeScope(allKtScopes), implicitReceiversTypes) @@ -145,14 +145,14 @@ internal class KtFirScopeProvider( ?.getNonStrictParentOfType() ?.takeIf { it.textOffset == offset } - private fun convertToKtScope(firScope: FirScope): KtScope? { + private fun convertToKtScope(firScope: FirScope): KtScope { firScopeStorage.register(firScope) return when (firScope) { is FirAbstractSimpleImportingScope -> KtFirNonStarImportingScope(firScope, builder, token) is FirAbstractStarImportingScope -> KtFirStarImportingScope(firScope, builder, project, token) is FirPackageMemberScope -> KtFirPackageScope(firScope, project, builder, token) is FirContainingNamesAwareScope -> KtFirDelegatingScopeImpl(firScope, builder, token) - is FirMemberTypeParameterScope -> null + is FirMemberTypeParameterScope -> KtFirDelegatingScopeImpl(firScope, builder, token) else -> TODO(firScope::class.toString()) } }