@@ -445,6 +445,16 @@ class NamespaceNode extends NameBindingNode {
445445 exists ( this .getOwnMember ( name , any ( ShadowingKeyOpt opt | opt .asSome ( ) = shadowingKey ) ) )
446446 }
447447
448+ bindingset [ n]
449+ private predicate isInheritable ( NameBindingNode n ) {
450+ isInheritableMemberNode ( n ) and
451+ // prevent self-inheritance
452+ not exists ( ClassLikeDeclaration self |
453+ this .isStaticMemberNamespace ( self ) and
454+ n .isMember ( self )
455+ )
456+ }
457+
448458 /**
449459 * Gets a potential member of this namespace of the given name.
450460 *
@@ -457,7 +467,7 @@ class NamespaceNode extends NameBindingNode {
457467 or
458468 not this .hasOwnMemberWithShadowingKey ( name , shadowingKey .asSome ( ) ) and
459469 result = this .getAnInheritanceParent ( ) .getMemberFull ( name , shadowingKey ) and
460- isInheritableMemberNode ( result )
470+ this . isInheritable ( result )
461471 or
462472 result = this .getAnExtension ( ) .getMemberFull ( name , shadowingKey )
463473 }
@@ -475,7 +485,7 @@ class NamespaceNode extends NameBindingNode {
475485 parent = this .getAnInheritanceParent ( ) and
476486 not this .hasOwnMemberWithShadowingKey ( name , shadowingKey .asSome ( ) ) and
477487 result = parent .getMember ( name , shadowingKey ) and
478- isInheritableMemberNode ( result )
488+ this . isInheritable ( result )
479489 )
480490 )
481491 }
@@ -750,8 +760,7 @@ predicate unqualifiedMemberAccess(
750760 ClassLikeDeclaration accessingClass
751761) {
752762 CachedStage:: ref ( ) and
753- unqualifiedMemberAccessCand ( pragma [ only_bind_into ] ( access ) , instanceAccess , target ,
754- pragma [ only_bind_into ] ( accessingClass ) ) and
763+ unqualifiedMemberAccessCand ( access , instanceAccess , target , accessingClass ) and
755764 accessingClass .getDepth ( ) = unqualifiedMemberAccessDepth ( access )
756765}
757766
0 commit comments