@@ -16,7 +16,7 @@ newtype TType =
1616 TArrayType ( ) or // todo: add size?
1717 TRefType ( ) or // todo: add mut?
1818 TTypeParamTypeParameter ( TypeParam t ) or
19- TAssociatedTypeTypeParameter ( TypeAlias t ) { any ( TraitItemNode trait ) .getADescendant ( ) = t } or
19+ TAssociatedTypeTypeParameter ( TypeAlias t ) { any ( TraitItemNode trait ) .getAnAssocItem ( ) = t } or
2020 TRefTypeParameter ( ) or
2121 TSelfTypeParameter ( Trait t )
2222
@@ -333,7 +333,11 @@ class TypeParamTypeParameter extends TypeParameter, TTypeParamTypeParameter {
333333 }
334334}
335335
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+ */
337341predicate traitAliasIndex ( Trait trait , int i , TypeAlias typeAlias ) {
338342 typeAlias =
339343 rank [ i + 1 - trait .getNumberOfGenericParams ( ) ] ( TypeAlias alias |
@@ -354,7 +358,7 @@ predicate traitAliasIndex(Trait trait, int i, TypeAlias typeAlias) {
354358 * // ...
355359 * }
356360 * ```
357- * is treated as if it where
361+ * is treated as if it was
358362 * ```rust
359363 * trait ATrait<AssociatedType> {
360364 * // ...
@@ -369,9 +373,9 @@ class AssociatedTypeTypeParameter extends TypeParameter, TAssociatedTypeTypePara
369373 TypeAlias getTypeAlias ( ) { result = typeAlias }
370374
371375 /** Gets the trait that contains this associated type declaration. */
372- TraitItemNode getTrait ( ) { result .getADescendant ( ) = typeAlias }
376+ TraitItemNode getTrait ( ) { result .getAnAssocItem ( ) = typeAlias }
373377
374- int getIndex ( ) { traitAliasIndex ( this . getTrait ( ) , result , typeAlias ) }
378+ int getIndex ( ) { traitAliasIndex ( _ , result , typeAlias ) }
375379
376380 override Function getMethod ( string name ) { none ( ) }
377381
0 commit comments