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 58d2e0c0968..a523c8fa6ff 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.mapTo(this, ::convertToKtScope) - nonLocalScopes.mapTo(this, ::convertToKtScope) - firLocalScopes.mapTo(this, ::convertToKtScope) + implicitReceiverScopes.mapNotNullTo(this, ::convertToKtScope) + nonLocalScopes.mapNotNullTo(this, ::convertToKtScope) + firLocalScopes.mapNotNullTo(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 -> KtFirMemberTypeParameterStubbingScope(firScope, token) + is FirMemberTypeParameterScope -> null else -> TODO(firScope::class.toString()) } } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/scopes/KtFirMemberTypeParameterStubbingScope.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/scopes/KtFirMemberTypeParameterStubbingScope.kt deleted file mode 100644 index 3cf4979e6cc..00000000000 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/scopes/KtFirMemberTypeParameterStubbingScope.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.frontend.api.fir.scopes - -import org.jetbrains.kotlin.fir.scopes.impl.FirMemberTypeParameterScope -import org.jetbrains.kotlin.idea.frontend.api.ValidityToken -import org.jetbrains.kotlin.idea.frontend.api.scopes.KtScope -import org.jetbrains.kotlin.idea.frontend.api.symbols.KtCallableSymbol -import org.jetbrains.kotlin.idea.frontend.api.symbols.KtClassLikeSymbol -import org.jetbrains.kotlin.name.Name - -// Does nothing, it is used to close the hole in KtFirScopeProvider -// TODO: check if this scope should provide something useful -class KtFirMemberTypeParameterStubbingScope( - val firMemberTypeParameterScope: FirMemberTypeParameterScope, - override val token: ValidityToken, -) : KtScope { - override fun getCallableNames(): Set { - return emptySet() - } - - override fun getClassLikeSymbolNames(): Set { - return emptySet() - } - - override fun getCallableSymbols(): Sequence { - return emptySequence() - } - - override fun getClassClassLikeSymbols(): Sequence { - return emptySequence() - } -} \ No newline at end of file