[FIR] Process all overridden members from intersection scopes

Previously, there was a contract that each callable symbol in the chain
  of `processDirectOverriddenWithBaseScope` will be unique. And if some
  symbol is accessible from multiple scopes, then only last of them will
  be returned as a component of `MemberWithScope`

But after the change from previous commit, we don't have this contract anymore.
  Which means that we may meet the same symbol during processing hierarchy
  of overridden functions (but with different base scopes)

So if some code utilizes `process...Overridden...WithBaseScope` functions
  it should consider that the same symbol may be obtained several times

^KT-63738 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-12-06 15:40:00 +02:00
committed by Space Team
parent c34511af37
commit 4272f2e156
6 changed files with 25 additions and 26 deletions
@@ -2,7 +2,8 @@ SomeMap:
[Enhancement]: public abstract fun containsKey(key: R|ft<K3 & Any, K3?>|): R|kotlin/Boolean| from Java enhancement scope for /SomeMap [id: 0]
[SubstitutionOverride(DeclarationSite)]: public abstract fun containsKey(key: R|ft<K3 & Any, K3?>|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
[SubstitutionOverride(DeclarationSite)]: public abstract fun containsKey(key: R|K|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableMap [id: 2]
[Library]: public abstract fun containsKey(key: R|K|): R|kotlin/Boolean| from Use site scope of kotlin/collections/Map [id: 3]
[SubstitutionOverride(DeclarationSite)]: public abstract fun containsKey(key: R|K|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/Map] for type kotlin/collections/MutableMap<K, V> [id: 2]
[Library]: public abstract fun containsKey(key: R|K|): R|kotlin/Boolean| from Use site scope of kotlin/collections/Map [id: 3]
[SubstitutionOverride(DeclarationSite)]: public abstract fun containsKey(key: R|kotlin/Any!|): R|kotlin/Boolean| from Substitution scope for [Java enhancement scope for /MyMap] for type SomeMap<K3, V3> [id: 4]
[Enhancement]: public abstract fun containsKey(key: R|kotlin/Any!|): R|kotlin/Boolean| from Java enhancement scope for /MyMap [id: 5]
[SubstitutionOverride(DeclarationSite)]: public abstract fun containsKey(key: R|kotlin/Any!|): R|kotlin/Boolean| from Substitution scope for [Java enhancement scope for /MyBaseMap] for type MyMap<K2, V2> [id: 6]
@@ -10,20 +11,23 @@ SomeMap:
[IntersectionOverride]: public abstract fun containsValue(value: R|ft<V3 & Any, V3?>|): R|kotlin/Boolean| from Java enhancement scope for /SomeMap [id: 0]
[SubstitutionOverride(DeclarationSite)]: public abstract fun containsValue(value: R|ft<V3 & Any, V3?>|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
[SubstitutionOverride(DeclarationSite)]: public abstract fun containsValue(value: R|V|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableMap [id: 2]
[Library]: public abstract fun containsValue(value: R|V|): R|kotlin/Boolean| from Use site scope of kotlin/collections/Map [id: 3]
[SubstitutionOverride(DeclarationSite)]: public abstract fun containsValue(value: R|V|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/Map] for type kotlin/collections/MutableMap<K, V> [id: 2]
[Library]: public abstract fun containsValue(value: R|V|): R|kotlin/Boolean| from Use site scope of kotlin/collections/Map [id: 3]
[SubstitutionOverride(DeclarationSite)]: public abstract fun containsValue(key: R|kotlin/Any!|): R|kotlin/Boolean| from Substitution scope for [Java enhancement scope for /MyMap] for type SomeMap<K3, V3> [id: 4]
[Enhancement]: public abstract fun containsValue(key: R|kotlin/Any!|): R|kotlin/Boolean| from Java enhancement scope for /MyMap [id: 5]
[IntersectionOverride]: public abstract operator fun get(key: R|ft<K3 & Any, K3?>|): R|V3?| from Java enhancement scope for /SomeMap [id: 0]
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun get(key: R|ft<K3 & Any, K3?>|): R|V3?| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun get(key: R|K|): R|V?| from Use site scope of kotlin/collections/MutableMap [id: 2]
[Library]: public abstract operator fun get(key: R|K|): R|V?| from Use site scope of kotlin/collections/Map [id: 3]
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun get(key: R|K|): R|V?| from Substitution scope for [Use site scope of kotlin/collections/Map] for type kotlin/collections/MutableMap<K, V> [id: 2]
[Library]: public abstract operator fun get(key: R|K|): R|V?| from Use site scope of kotlin/collections/Map [id: 3]
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun get(key: R|ft<K3 & Any, K3?>|): R|ft<V3 & Any, V3?>| from Substitution scope for [Java enhancement scope for /MyMap] for type SomeMap<K3, V3> [id: 4]
[Enhancement]: public abstract operator fun get(key: R|ft<K2 & Any, K2?>|): R|ft<V2 & Any, V2?>| from Java enhancement scope for /MyMap [id: 5]
[Enhancement]: public abstract fun remove(key: R|ft<K3 & Any, K3?>|): R|V3?| from Java enhancement scope for /SomeMap [id: 0]
[SubstitutionOverride(DeclarationSite)]: public abstract fun remove(key: R|ft<K3 & Any, K3?>|): R|V3?| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
[Library]: public abstract fun remove(key: R|K|): R|V?| from Use site scope of kotlin/collections/MutableMap [id: 2]
[SubstitutionOverride(DeclarationSite)]: public open fun remove(key: R|ft<K3 & Any, K3?>|, value: R|ft<V3 & Any, V3?>|): R|kotlin/Boolean| from Java enhancement scope for /SomeMap [id: 0]
[Library]: public open fun remove(key: R|K|, value: R|V|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableMap [id: 1]
[SubstitutionOverride(DeclarationSite)]: public open fun remove(key: R|ft<K3 & Any, K3?>|, value: R|ft<V3 & Any, V3?>|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 0]
[Library]: public open fun remove(key: R|K|, value: R|V|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableMap [id: 1]
MyMap:
[Enhancement]: public abstract fun containsKey(key: R|kotlin/Any!|): R|kotlin/Boolean| from Java enhancement scope for /MyMap [id: 0]