@@ -1539,11 +1539,8 @@ private List<IMembership> QueryBindingMemberships(INamespace scope, bool visible
15391539
15401540 foreach ( var impliedGeneral in this . QueryImpliedGeneralClosure ( type , declaredSupertypes ) )
15411541 {
1542- if ( impliedGeneral is INamespace impliedGeneralAsNamespace )
1543- {
1544- memberships . AddRange ( QueryOwnedMembershipsSafe ( impliedGeneralAsNamespace )
1545- . Where ( ownedMember => ownedMember . Visibility != VisibilityKind . Private && PassesVisibilityFilter ( ownedMember , visibleOnly ) ) ) ;
1546- }
1542+ memberships . AddRange ( QueryOwnedMembershipsSafe ( impliedGeneral )
1543+ . Where ( ownedMember => ownedMember . Visibility != VisibilityKind . Private && PassesVisibilityFilter ( ownedMember , visibleOnly ) ) ) ;
15471544
15481545 memberships . AddRange ( QueryInheritedMembershipsSafe ( impliedGeneral ) . Where ( inheritedMember => PassesVisibilityFilter ( inheritedMember , visibleOnly ) ) ) ;
15491546 }
@@ -2207,10 +2204,7 @@ private void BuildInheritedEntries(IType type, Dictionary<string, HashSet<IEleme
22072204 // `pending` feeds INDEX construction only — it is not the traversal that emits output — so
22082205 // indexing the general as a scope in its own right keeps the fix lookup-only while making
22092206 // the names it owns resolvable.
2210- if ( impliedGeneral is INamespace impliedGeneralAsNamespace )
2211- {
2212- pending . Enqueue ( ( impliedGeneralAsNamespace , isGlobal ) ) ;
2213- }
2207+ pending . Enqueue ( ( impliedGeneral , isGlobal ) ) ;
22142208
22152209 AddImpliedLookupEntries ( impliedGeneral , index , isGlobal ) ;
22162210 }
@@ -2346,22 +2340,17 @@ private List<IType> QueryImpliedGeneralClosure(IType type, List<IType> declaredS
23462340 /// <param name="isGlobal">Whether the owning scope is reached through the global namespace.</param>
23472341 private static void AddImpliedLookupEntries ( IType impliedGeneral , Dictionary < string , HashSet < IElement > > index , bool isGlobal )
23482342 {
2349- var contributed = new List < IMembership > ( ) ;
2350-
2351- switch ( impliedGeneral )
2343+ if ( impliedGeneral == null )
23522344 {
2353- case null :
2354- return ;
2355- case INamespace impliedGeneralAsNamespace :
2356- // Stricter than the declared-supertype walk on purpose: an implied general is reached
2357- // without any authored relationship, so its private internals are never exposed, even in a
2358- // non-global scope where PassesVisibilityFilter alone would admit them.
2359- contributed . AddRange ( impliedGeneralAsNamespace . ownedMembership
2360- . Where ( ownedMember => ownedMember . Visibility != VisibilityKind . Private ) ) ;
2361-
2362- break ;
2345+ return ;
23632346 }
23642347
2348+ // Stricter than the declared-supertype walk on purpose: an implied general is reached without
2349+ // any authored relationship, so its private internals are never exposed, even in a non-global
2350+ // scope where PassesVisibilityFilter alone would admit them.
2351+ var contributed = new List < IMembership > ( impliedGeneral . ownedMembership
2352+ . Where ( ownedMember => ownedMember . Visibility != VisibilityKind . Private ) ) ;
2353+
23652354 try
23662355 {
23672356 contributed . AddRange ( impliedGeneral . inheritedMembership ) ;
0 commit comments