@@ -114,6 +114,9 @@ private newtype TPrintAstNode =
114
114
TConceptIdExprArgumentsNode ( ConceptIdExpr concept ) {
115
115
shouldPrintDeclaration ( getAnEnclosingDeclaration ( concept ) )
116
116
} or
117
+ TConceptIdExprTypeArgumentNode ( Type type , ConceptIdExpr concept , int childIndex ) {
118
+ type = concept .getTemplateArgument ( childIndex )
119
+ } or
117
120
TConstructorInitializersNode ( Constructor ctor ) {
118
121
ctor .hasEntryPoint ( ) and
119
122
shouldPrintDeclaration ( ctor )
@@ -601,19 +604,6 @@ class ParameterNode extends AstNode {
601
604
}
602
605
}
603
606
604
- /**
605
- * A node representing a `Type`.
606
- */
607
- class TypeNode extends AstNode {
608
- Type t ;
609
-
610
- TypeNode ( ) { t = ast }
611
-
612
- final override PrintAstNode getChildInternal ( int childIndex ) { none ( ) }
613
-
614
- final override string getChildAccessorPredicateInternal ( int childIndex ) { none ( ) }
615
- }
616
-
617
607
/**
618
608
* A node representing an `Initializer`.
619
609
*/
@@ -645,8 +635,12 @@ class ConceptIdExprArgumentsNode extends PrintAstNode, TConceptIdExprArgumentsNo
645
635
646
636
final override Location getLocation ( ) { result = getRepresentativeLocation ( concept ) }
647
637
648
- override AstNode getChildInternal ( int childIndex ) {
649
- result .getAst ( ) = concept .getTemplateArgument ( childIndex )
638
+ override PrintAstNode getChildInternal ( int childIndex ) {
639
+ exists ( Locatable arg | arg = concept .getTemplateArgument ( childIndex ) |
640
+ result .( ConceptIdExprTypeArgumentNode ) .isArgumentNode ( arg , concept , childIndex )
641
+ or
642
+ result .( ExprNode ) .getAst ( ) = arg
643
+ )
650
644
}
651
645
652
646
override string getChildAccessorPredicateInternal ( int childIndex ) {
@@ -660,6 +654,32 @@ class ConceptIdExprArgumentsNode extends PrintAstNode, TConceptIdExprArgumentsNo
660
654
final ConceptIdExpr getConceptIdExpr ( ) { result = concept }
661
655
}
662
656
657
+ /**
658
+ * A node representing a type argument of a `ConceptIdExpr`.
659
+ */
660
+ class ConceptIdExprTypeArgumentNode extends PrintAstNode , TConceptIdExprTypeArgumentNode {
661
+ Type type ;
662
+ ConceptIdExpr concept ;
663
+ int index ;
664
+
665
+ ConceptIdExprTypeArgumentNode ( ) { this = TConceptIdExprTypeArgumentNode ( type , concept , index ) }
666
+
667
+ final override string toString ( ) { result = qlClass ( type ) + type .toString ( ) }
668
+
669
+ final override Location getLocation ( ) { result = getRepresentativeLocation ( type ) }
670
+
671
+ override AstNode getChildInternal ( int childIndex ) { none ( ) }
672
+
673
+ override string getChildAccessorPredicateInternal ( int childIndex ) { none ( ) }
674
+
675
+ /**
676
+ * Holds if `t` is the `i`th template argument of `c`.
677
+ */
678
+ predicate isArgumentNode ( Type t , ConceptIdExpr c , int i ) {
679
+ type = t and concept = c and index = i
680
+ }
681
+ }
682
+
663
683
/**
664
684
* A node representing the parameters of a `Function`.
665
685
*/
0 commit comments