@@ -16,7 +16,7 @@ newtype TType =
16
16
TArrayType ( ) or // todo: add size?
17
17
TRefType ( ) or // todo: add mut?
18
18
TTypeParamTypeParameter ( TypeParam t ) or
19
- TAssociatedTypeTypeParameter ( TypeAlias t ) { any ( TraitItemNode trait ) .getADescendant ( ) = t } or
19
+ TAssociatedTypeTypeParameter ( TypeAlias t ) { any ( TraitItemNode trait ) .getAnAssocItem ( ) = t } or
20
20
TRefTypeParameter ( ) or
21
21
TSelfTypeParameter ( Trait t )
22
22
@@ -333,7 +333,11 @@ class TypeParamTypeParameter extends TypeParameter, TTypeParamTypeParameter {
333
333
}
334
334
}
335
335
336
- /** Gets type alias that is the `i`th type parameter of `trait`. */
336
+ /**
337
+ * Gets the type alias that is the `i`th type parameter of `trait`. Type aliases
338
+ * are numbered consecutively but in arbitrary order, starting from the index
339
+ * following the last ordinary type parameter.
340
+ */
337
341
predicate traitAliasIndex ( Trait trait , int i , TypeAlias typeAlias ) {
338
342
typeAlias =
339
343
rank [ i + 1 - trait .getNumberOfGenericParams ( ) ] ( TypeAlias alias |
@@ -354,7 +358,7 @@ predicate traitAliasIndex(Trait trait, int i, TypeAlias typeAlias) {
354
358
* // ...
355
359
* }
356
360
* ```
357
- * is treated as if it where
361
+ * is treated as if it was
358
362
* ```rust
359
363
* trait ATrait<AssociatedType> {
360
364
* // ...
@@ -369,9 +373,9 @@ class AssociatedTypeTypeParameter extends TypeParameter, TAssociatedTypeTypePara
369
373
TypeAlias getTypeAlias ( ) { result = typeAlias }
370
374
371
375
/** Gets the trait that contains this associated type declaration. */
372
- TraitItemNode getTrait ( ) { result .getADescendant ( ) = typeAlias }
376
+ TraitItemNode getTrait ( ) { result .getAnAssocItem ( ) = typeAlias }
373
377
374
- int getIndex ( ) { traitAliasIndex ( this . getTrait ( ) , result , typeAlias ) }
378
+ int getIndex ( ) { traitAliasIndex ( _ , result , typeAlias ) }
375
379
376
380
override Function getMethod ( string name ) { none ( ) }
377
381
0 commit comments