@@ -20,12 +20,11 @@ final class AssocType extends TypeAlias {
2020}
2121
2222/** Gets an associated type of `trait` or of a supertrait of `trait`. */
23- AssocType getTraitAssocType ( Trait trait ) {
24- result .getTrait ( ) = trait .getSupertrait * ( )
25- }
23+ AssocType getTraitAssocType ( Trait trait ) { result .getTrait ( ) = trait .getSupertrait * ( ) }
2624
2725/** Holds if `path` is of the form `<type as trait>::name` */
28- predicate asTraitPath ( Path path , TypeRepr typeRepr , Path traitPath , string name ) {
26+ pragma [ nomagic]
27+ predicate pathTypeAsTraitAssoc ( Path path , TypeRepr typeRepr , Path traitPath , string name ) {
2928 exists ( PathSegment segment |
3029 segment = path .getQualifier ( ) .getSegment ( ) and
3130 typeRepr = segment .getTypeRepr ( ) and
@@ -45,8 +44,8 @@ predicate tpAssociatedType(TypeParam tp, AssocType assoc, Path path) {
4544 resolvePath ( path ) = assoc
4645 or
4746 exists ( PathTypeRepr typeRepr , Path traitPath , string name |
48- asTraitPath ( path , typeRepr , traitPath , name ) and
49- tp = resolvePath ( typeRepr .( PathTypeRepr ) . getPath ( ) ) and
47+ pathTypeAsTraitAssoc ( path , typeRepr , traitPath , name ) and
48+ tp = resolvePath ( typeRepr .getPath ( ) ) and
5049 assoc = resolvePath ( traitPath ) .( TraitItemNode ) .getAssocItem ( name )
5150 )
5251}
0 commit comments