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 f438497a37a..2398a1599ff 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 @@ -137,7 +137,10 @@ internal class KtFirScopeProvider( firLocalScopes.mapTo(this, ::convertToKtScope) } - KtScopeContext(getCompositeScope(allKtScopes), implicitReceiversTypes) + KtScopeContext( + getCompositeScope(allKtScopes.asReversed()), + implicitReceiversTypes.asReversed() + ) } private fun KtFile.findFunctionDeclarationAt(offset: Int): KtNamedFunction? =