diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.kt index 26321e60d20..bcfe6f55d8e 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.kt @@ -27,8 +27,8 @@ abstract class Impl : Base { // FILE: test.kt -abstract class ImplDerived : Impl(), Derived { - abstract override fun foo(name: String?): Derived +abstract class ImplDerived : Impl(), Derived { + abstract override fun foo(name: String?): Derived } abstract class DerivedImpl : Derived, Impl() { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.overrides.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.overrides.txt index 9a453e0fd81..1b511e94c29 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.overrides.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.overrides.txt @@ -1,6 +1,5 @@ ImplDerived: [Source]: public abstract override fun foo(name: R|kotlin/String?|): R|Derived| from Use site scope of /ImplDerived [id: 0] - [IntersectionOverride]: public open fun foo(name: R|ft|): R|@EnhancedNullability Derived| from Use site scope of /ImplDerived [id: 0] [Source]: public open override fun foo(name: R|kotlin/String|): R|Base| from Use site scope of /Impl [id: 1] [Enhancement]: public abstract fun foo(name: R|@EnhancedNullability kotlin/String|): R|ft| from Java enhancement scope for /Base [id: 2] [Enhancement]: public abstract fun foo(name: R|ft|): R|@EnhancedNullability Derived| from Java enhancement scope for /Derived [id: 3] diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirUseSiteMemberScope.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirUseSiteMemberScope.kt index 52a86f279bd..b17197f355e 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirUseSiteMemberScope.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirUseSiteMemberScope.kt @@ -130,7 +130,7 @@ abstract class AbstractFirUseSiteMemberScope( * * TODO: is it enough to check only one function? */ - firstMember + mostSpecific } else { chosenSymbol } diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScopeContext.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScopeContext.kt index 998248eff6d..5e4a108c8d8 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScopeContext.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScopeContext.kt @@ -73,8 +73,8 @@ class FirTypeIntersectionScopeContext( ).member as D } - val firstMember: D - get() = context.extractedOverrides.first().member + val mostSpecific: D + get() = context.mostSpecific } }