@@ -37,26 +37,6 @@ private module Input1 implements InputSig1<Location> {
3737
3838 class TypeAbstraction = TA:: TypeAbstraction ;
3939
40- class TypeArgumentPosition = int ;
41-
42- private newtype TTypeParameterPosition = TTypeParamTypeParameterPosition ( TypeParameter tp )
43-
44- class TypeParameterPosition extends TTypeParameterPosition {
45- TypeParameter asTypeParameter ( ) { this = TTypeParamTypeParameterPosition ( result ) }
46-
47- TypeParam asTypeParam ( ) {
48- result = this .asTypeParameter ( ) .( TypeParamTypeParameter ) .getTypeParam ( )
49- }
50-
51- string toString ( ) { result = this .asTypeParameter ( ) .toString ( ) }
52- }
53-
54- bindingset [ apos]
55- bindingset [ ppos]
56- predicate typeArgumentParameterPositionMatch ( TypeArgumentPosition apos , TypeParameterPosition ppos ) {
57- apos = ppos .asTypeParam ( ) .getPosition ( )
58- }
59-
6040 int getTypeParameterId ( TypeParameter tp ) {
6141 tp =
6242 rank [ result ] ( TypeParameter tp0 , int kind , int id1 , int id2 |
@@ -421,7 +401,7 @@ private module Input3 implements InputSig3 {
421401 final class Parameterizable = ParameterizableImpl ;
422402
423403 abstract private class ParameterizableImpl extends AstNode {
424- abstract TypeParameter getTypeParameter ( TypeParameterPosition ppos ) ;
404+ abstract TypeParameter getTypeParameter ( int pos ) ;
425405
426406 abstract TypeMention getAdditionalTypeParameterConstraint ( TypeParameter tp ) ;
427407
@@ -443,8 +423,8 @@ private module Input3 implements InputSig3 {
443423 )
444424 }
445425
446- override TypeParameter getTypeParameter ( TypeParameterPosition ppos ) {
447- result = this .( FunctionDeclaration ) .getTypeParameter ( ppos )
426+ override TypeParameter getTypeParameter ( int pos ) {
427+ result = this .( FunctionDeclaration ) .getTypeParameter ( pos )
448428 }
449429
450430 override TypeMention getAdditionalTypeParameterConstraint ( TypeParameter tp ) {
@@ -475,9 +455,9 @@ private module Input3 implements InputSig3 {
475455
476456 override TypeMention getAdditionalTypeParameterConstraint ( TypeParameter tp ) { none ( ) }
477457
478- override TypeParameter getTypeParameter ( TypeParameterPosition ppos ) {
479- result = ppos . asTypeParameter ( ) and
480- ppos . asTypeParam ( ) = this .getTypeItem ( ) .getGenericParamList ( ) .getATypeParam ( )
458+ override TypeParameter getTypeParameter ( int pos ) {
459+ result . ( TypeParamTypeParameter ) . getTypeParam ( ) =
460+ this .getTypeItem ( ) .getGenericParamList ( ) .getTypeParam ( pos )
481461 }
482462
483463 override TypeMention getType ( ) { result = this .getTypeItem ( ) }
@@ -547,7 +527,7 @@ private module Input3 implements InputSig3 {
547527 abstract private class InvocationImpl extends Expr {
548528 abstract TypeMention getTypeQualifier ( ) ;
549529
550- abstract Type getTypeArgument ( TypeArgumentPosition apos , TypePath path ) ;
530+ abstract Type getTypeArgument ( int pos , TypePath path ) ;
551531
552532 abstract AstNode getArgument ( int i ) ;
553533
@@ -559,11 +539,11 @@ private module Input3 implements InputSig3 {
559539 override TypeMention getTypeQualifier ( ) { result = getCallExprTypeArgument2 ( this ) }
560540
561541 pragma [ nomagic]
562- override Type getTypeArgument ( TypeArgumentPosition apos , TypePath path ) {
542+ override Type getTypeArgument ( int pos , TypePath path ) {
563543 result =
564- this .( MethodCallExpr ) .getGenericArgList ( ) .getTypeArg ( apos ) .( TypeMention ) .getTypeAt ( path )
544+ this .( MethodCallExpr ) .getGenericArgList ( ) .getTypeArg ( pos ) .( TypeMention ) .getTypeAt ( path )
565545 or
566- result = getCallExprTypeArgument ( this , apos , path )
546+ result = getCallExprTypeArgument ( this , pos , path )
567547 }
568548
569549 override AstNode getArgument ( int i ) {
@@ -606,8 +586,8 @@ private module Input3 implements InputSig3 {
606586 override TypeMention getTypeQualifier ( ) { none ( ) }
607587
608588 pragma [ nomagic]
609- override Type getTypeArgument ( TypeArgumentPosition apos , TypePath path ) {
610- result = NonAssocCallExpr .super .getTypeArgument ( apos , path )
589+ override Type getTypeArgument ( int pos , TypePath path ) {
590+ result = NonAssocCallExpr .super .getTypeArgument ( pos , path )
611591 }
612592
613593 override AstNode getArgument ( int i ) {
@@ -643,8 +623,8 @@ private module Input3 implements InputSig3 {
643623
644624 override TypeMention getTypeQualifier ( ) { result = getCallExprTypeArgument2 ( this ) }
645625
646- override Type getTypeArgument ( TypeArgumentPosition apos , TypePath path ) {
647- result = NonAssocCallExpr .super .getTypeArgument ( apos , path )
626+ override Type getTypeArgument ( int pos , TypePath path ) {
627+ result = NonAssocCallExpr .super .getTypeArgument ( pos , path )
648628 }
649629
650630 override AstNode getArgument ( int i ) {
@@ -667,7 +647,7 @@ private module Input3 implements InputSig3 {
667647 }
668648
669649 pragma [ nomagic]
670- override Type getTypeArgument ( TypeArgumentPosition apos , TypePath path ) { none ( ) }
650+ override Type getTypeArgument ( int pos , TypePath path ) { none ( ) }
671651 }
672652
673653 private class StructExprConstruction extends StructConstruction , StructExpr {
@@ -1150,21 +1130,27 @@ private class FunctionDeclaration extends Function {
11501130 this = i .asSome ( ) .getAnAssocItem ( )
11511131 }
11521132
1153- TypeParam getTypeParam ( ImplOrTraitItemNodeOption i ) {
1133+ private TypeParam getTypeParam ( ImplOrTraitItemNodeOption i , int j ) {
11541134 i = parent and
1155- result = [ this .getGenericParamList ( ) .getATypeParam ( ) , i .asSome ( ) .getTypeParam ( _) ]
1135+ (
1136+ result = this .getGenericParamList ( ) .getTypeParam ( j )
1137+ or
1138+ result = i .asSome ( ) .getTypeParam ( _) and
1139+ j = - 1
1140+ )
11561141 }
11571142
1158- private TypeParameter getTypeParameter ( ImplOrTraitItemNodeOption i , TypeParameterPosition ppos ) {
1159- result = ppos .asTypeParameter ( ) and
1143+ private TypeParameter getTypeParameter ( ImplOrTraitItemNodeOption i , int pos ) {
11601144 (
1161- result = TTypeParamTypeParameter ( this .getTypeParam ( i ) )
1145+ result = TTypeParamTypeParameter ( this .getTypeParam ( i , pos ) )
11621146 or
11631147 // For every `TypeParam` of this function, any associated types accessed on
11641148 // the type parameter are also type parameters.
1165- result .( TypeParamAssociatedTypeTypeParameter ) .getTypeParam ( ) = this .getTypeParam ( i )
1149+ result .( TypeParamAssociatedTypeTypeParameter ) .getTypeParam ( ) = this .getTypeParam ( i , _) and
1150+ pos = - 1
11661151 or
11671152 i = parent and
1153+ pos = - 1 and
11681154 (
11691155 result = TSelfTypeParameter ( i .asSome ( ) )
11701156 or
@@ -1175,8 +1161,8 @@ private class FunctionDeclaration extends Function {
11751161 )
11761162 }
11771163
1178- TypeParameter getTypeParameter ( TypeParameterPosition ppos ) {
1179- exists ( ImplOrTraitItemNodeOption i | result = this .getTypeParameter ( i , ppos ) |
1164+ TypeParameter getTypeParameter ( int pos ) {
1165+ exists ( ImplOrTraitItemNodeOption i | result = this .getTypeParameter ( i , pos ) |
11801166 i .isNone ( )
11811167 or
11821168 i .asSome ( ) .getAnAssocItem ( ) = this
@@ -1337,9 +1323,7 @@ private class NonAssocCallExpr extends CallExpr {
13371323 ItemNode resolveCallTargetViaPathResolution ( ) { result = CallExprImpl:: getResolvedFunction ( this ) }
13381324
13391325 pragma [ nomagic]
1340- Type getTypeArgument ( TypeArgumentPosition apos , TypePath path ) {
1341- result = getCallExprTypeArgument ( this , apos , path )
1342- }
1326+ Type getTypeArgument ( int pos , TypePath path ) { result = getCallExprTypeArgument ( this , pos , path ) }
13431327
13441328 AstNode getNodeAt ( FunctionPosition pos ) {
13451329 result = this .getSyntacticArgument ( pos .asArgumentPosition ( ) )
@@ -3072,7 +3056,7 @@ private module DeconstructionPatMatchingInput implements MatchingInputSig {
30723056 class Access extends Pat instanceof PathAstNode {
30733057 Access ( ) { this instanceof TupleStructPat or this instanceof StructPat }
30743058
3075- Type getTypeArgument ( TypeArgumentPosition apos , TypePath path ) { none ( ) }
3059+ Type getTypeArgument ( int pos , TypePath path ) { none ( ) }
30763060
30773061 AstNode getNodeAt ( AccessPosition apos ) {
30783062 this =
0 commit comments