@@ -62,18 +62,22 @@ class TypeReprMention extends TypeMention, TypeRepr {
62
62
}
63
63
}
64
64
65
- /** Holds if `path` resolves the type alias `alias` with the definition `rhs`. */
65
+ /** Holds if `path` resolves to the type alias `alias` with the definition `rhs`. */
66
66
private predicate resolvePathAlias ( Path path , TypeAlias alias , TypeReprMention rhs ) {
67
67
alias = resolvePath ( path ) and rhs = alias .getTypeRepr ( )
68
68
}
69
69
70
- abstract class PathMention extends TypeMention , Path { }
70
+ abstract class PathMention extends TypeMention , Path {
71
+ override TypeMention getTypeArgument ( int i ) {
72
+ result = this .getSegment ( ) .getGenericArgList ( ) .getTypeArg ( i )
73
+ }
74
+ }
71
75
72
76
class NonAliasPathMention extends PathMention {
73
77
NonAliasPathMention ( ) { not resolvePathAlias ( this , _, _) }
74
78
75
79
override TypeMention getTypeArgument ( int i ) {
76
- result = this . getSegment ( ) . getGenericArgList ( ) . getTypeArg ( i )
80
+ result = super . getTypeArgument ( i )
77
81
or
78
82
// `Self` paths inside `impl` blocks have implicit type arguments that are
79
83
// the type parameters of the `impl` block. For example, in
@@ -120,10 +124,6 @@ class AliasPathMention extends PathMention {
120
124
121
125
AliasPathMention ( ) { resolvePathAlias ( this , alias , rhs ) }
122
126
123
- override TypeMention getTypeArgument ( int i ) {
124
- result = this .getSegment ( ) .getGenericArgList ( ) .getTypeArg ( i )
125
- }
126
-
127
127
/** Get the `i`th type parameter of the alias itself. */
128
128
private TypeParameter getTypeParameter ( int i ) {
129
129
result = TTypeParamTypeParameter ( alias .getGenericParamList ( ) .getTypeParam ( i ) )
0 commit comments