@@ -1896,10 +1896,11 @@ private predicate isImplSelfQualifiedPath(
18961896 name = path .getText ( )
18971897}
18981898
1899- private TypeAliasItemNode resolveSelfAssocType ( PathExt qualifier , PathExt path ) {
1899+ private ItemNode resolveImplSelfQualified ( PathExt qualifier , PathExt path , Namespace ns ) {
19001900 exists ( ImplItemNode impl , string name |
19011901 isImplSelfQualifiedPath ( impl , qualifier , path , name ) and
1902- result = impl .getAssocItem ( name )
1902+ result = impl .getAssocItem ( name ) and
1903+ ns = result .getNamespace ( )
19031904 )
19041905}
19051906
@@ -1909,17 +1910,12 @@ private TypeAliasItemNode resolveSelfAssocType(PathExt qualifier, PathExt path)
19091910 */
19101911pragma [ nomagic]
19111912private ItemNode resolvePathCandQualified ( PathExt qualifier , ItemNode q , PathExt path , Namespace ns ) {
1912- // Special case for `Self::AssocType `; this always refers to the associated
1913- // type in the enclosing `impl` block, if available.
1913+ // Special case for `Self::Assoc `; this always refers to the associated
1914+ // item in the enclosing `impl` block, if available.
19141915 q = resolvePathCandQualifier ( qualifier , path , _) and
1915- ns .isType ( ) and
1916- result = resolveSelfAssocType ( qualifier , path )
1916+ result = resolveImplSelfQualified ( qualifier , path , ns )
19171917 or
1918- (
1919- not exists ( resolveSelfAssocType ( qualifier , path ) )
1920- or
1921- not ns .isType ( )
1922- ) and
1918+ not exists ( resolveImplSelfQualified ( qualifier , path , ns ) ) and
19231919 exists ( string name , SuccessorKind kind , UseOption useOpt |
19241920 q = resolvePathCandQualifier ( qualifier , path , name ) and
19251921 result = getASuccessor ( q , name , ns , kind , useOpt ) and
0 commit comments