KotlinIntersectionScopeMergeTarget¶
interface KotlinIntersectionScopeMergeTarget
A marker interface for GlobalSearchScopes that can be factored out of an intersection scope using the distributive property. This helps the intersection scope merge strategy to pick the correct targets.
The marker should be applied to scopes which have the following characteristics:
-
They are frequently applied in intersection scopes (e.g., via
KotlinContentScopeRefiner.getRestrictionScopes). -
The same scope is applied in multiple intersection scopes, allowing the scope merger to merge intersections by factoring it out.
Illustration¶
Take the following combination of sets A, B, and C (with & denoting intersection and | denoting union):
With the distributive law, we can factor out A:
Exactly the scope A would be marked with KotlinIntersectionScopeMergeTarget.