@@ -110,20 +110,18 @@ pragma[nomagic]
110110private ItemNode getAChildSuccessor ( ItemNode item , string name , SuccessorKind kind ) {
111111 item = result .getImmediateParent ( ) and
112112 name = result .getName ( ) and
113- (
114- // type parameters are only available inside the declaring item
115- if result instanceof TypeParam
116- then kind .isInternal ( )
113+ // type parameters are only available inside the declaring item
114+ if result instanceof TypeParam
115+ then kind .isInternal ( )
116+ else
117+ // associated items must always be qualified, also within the declaring
118+ // item (using `Self`)
119+ if item instanceof ImplOrTraitItemNode and result instanceof AssocItem
120+ then kind .isExternal ( )
117121 else
118- // associated items must always be qualified, also within the declaring
119- // item (using `Self`)
120- if item instanceof ImplOrTraitItemNode and result instanceof AssocItem
121- then kind .isExternal ( )
122- else
123- if result .isPublic ( )
124- then kind .isBoth ( )
125- else kind .isInternal ( )
126- )
122+ if result .isPublic ( )
123+ then kind .isBoth ( )
124+ else kind .isInternal ( )
127125}
128126
129127private module UseOption = Option< Use > ;
@@ -372,6 +370,13 @@ abstract class ItemNode extends Locatable {
372370 result = this .( TypeAliasItemNodeImpl ) .resolveAliasCand ( ) .getASuccessor ( name , kind , useOpt ) and
373371 kind .isExternalOrBoth ( )
374372 or
373+ // items declared at top-level inside macros are also available at the macro invocation sites
374+ exists ( BlockExprItemNode be |
375+ this = be .getImmediateParent ( ) and
376+ be = any ( MacroCall mc ) .getMacroCallExpansion ( ) and
377+ result = be .getASuccessor ( name , kind , useOpt )
378+ )
379+ or
375380 name = "super" and
376381 useOpt .isNone ( ) and
377382 (
0 commit comments