@@ -56,7 +56,11 @@ class AstNode extends TAstNode {
5656 * named `pred`.
5757 */
5858 cached
59- AstNode getAChild ( string pred ) { none ( ) }
59+ AstNode getAChild ( string pred ) {
60+ pred = directMember ( "getAnAnnotation" ) and result = getAnAnnotation ( )
61+ or
62+ pred = directMember ( "getQLDoc" ) and result = getQLDoc ( )
63+ }
6064
6165 /**
6266 * Gets the primary QL class for the ast node.
@@ -70,10 +74,7 @@ class AstNode extends TAstNode {
7074 predicate hasAnnotation ( string name ) { this .getAnAnnotation ( ) .getName ( ) = name }
7175
7276 /** Gets an annotation of this AST node. */
73- cached
74- Annotation getAnAnnotation ( ) {
75- toQL ( this ) .getParent ( ) = pragma [ only_bind_out ] ( toQL ( result ) ) .getParent ( )
76- }
77+ Annotation getAnAnnotation ( ) { toQL ( this ) .getParent ( ) = toQL ( result ) .getParent ( ) }
7778
7879 /**
7980 * Gets the predicate that contains this AST node.
@@ -119,8 +120,6 @@ class TopLevel extends TTopLevel, AstNode {
119120 NewType getANewType ( ) { result = this .getAMember ( ) }
120121
121122 override ModuleMember getAChild ( string pred ) {
122- pred = directMember ( "getQLDoc" ) and result = this .getQLDoc ( )
123- or
124123 pred = directMember ( "getAnImport" ) and result = this .getAnImport ( )
125124 or
126125 pred = directMember ( "getAClass" ) and result = this .getAClass ( )
@@ -626,7 +625,7 @@ class TypeExpr extends TType, AstNode {
626625 */
627626 Type getResolvedType ( ) { resolveTypeExpr ( this , result ) }
628627
629- override ModuleExpr getAChild ( string pred ) {
628+ override AstNode getAChild ( string pred ) {
630629 result = super .getAChild ( pred )
631630 or
632631 pred = directMember ( "getModule" ) and result = this .getModule ( )
@@ -691,11 +690,7 @@ class Declaration extends TDeclaration, AstNode {
691690 result = any ( Class c ) .getQLDocFor ( this )
692691 }
693692
694- override AstNode getAChild ( string pred ) {
695- result = super .getAChild ( pred )
696- or
697- pred = directMember ( "getQLDoc" ) and result = this .getQLDoc ( )
698- }
693+ override AstNode getAChild ( string pred ) { result = super .getAChild ( pred ) }
699694}
700695
701696/** An entity that can be declared in a module. */
@@ -784,6 +779,8 @@ class Class extends TClass, TypeDeclaration, ModuleDeclaration {
784779 or
785780 pred = directMember ( "getASuperType" ) and result = this .getASuperType ( )
786781 or
782+ pred = directMember ( "getAnInstanceofType" ) and result = this .getAnInstanceofType ( )
783+ or
787784 exists ( string name |
788785 pred = stringIndexedMember ( "getClassPredicate" , name ) and
789786 result = this .getClassPredicate ( name )
@@ -860,8 +857,6 @@ class NewTypeBranch extends TNewTypeBranch, PredicateOrBuiltin, TypeDeclaration
860857 pred = directMember ( "getBody" ) and result = this .getBody ( )
861858 or
862859 exists ( int i | pred = indexedMember ( "getField" , i ) and result = this .getField ( i ) )
863- or
864- pred = directMember ( "getQLDoc" ) and result = this .getQLDoc ( )
865860 }
866861}
867862
@@ -2196,6 +2191,12 @@ class Annotation extends TAnnotation, AstNode {
21962191
21972192 /** Gets the node corresponding to the field `name`. */
21982193 string getName ( ) { result = annot .getName ( ) .getValue ( ) }
2194+
2195+ override AstNode getAChild ( string pred ) {
2196+ result = super .getAChild ( pred )
2197+ or
2198+ exists ( int i | pred = indexedMember ( "getArgs" , i ) and result = this .getArgs ( i ) )
2199+ }
21992200}
22002201
22012202/** A `pragma[noinline]` annotation. */
0 commit comments