@@ -295,6 +295,11 @@ abstract class ImplOrTraitItemNode extends ItemNode {
295295 predicate hasAssocItem ( string name ) { name = this .getAnAssocItem ( ) .getName ( ) }
296296}
297297
298+ pragma [ nomagic]
299+ private TypeParamItemNode resolveTypeParamPathTypeRepr ( PathTypeRepr ptr ) {
300+ result = resolvePath ( ptr .getPath ( ) )
301+ }
302+
298303class ImplItemNode extends ImplOrTraitItemNode instanceof Impl {
299304 Path getSelfPath ( ) { result = super .getSelfTy ( ) .( PathTypeRepr ) .getPath ( ) }
300305
@@ -310,12 +315,6 @@ class ImplItemNode extends ImplOrTraitItemNode instanceof Impl {
310315 this .getSelfPath ( ) .getPart ( ) .getGenericArgList ( ) .getAGenericArg ( ) .( TypeArg ) .getTypeRepr ( )
311316 }
312317
313- pragma [ nomagic]
314- private TypeParamItemNode getASelfTyTypeParamArg ( TypeRepr arg ) {
315- arg = this .getASelfTyArg ( ) and
316- result = resolvePath ( arg .( PathTypeRepr ) .getPath ( ) )
317- }
318-
319318 /**
320319 * Holds if this `impl` block is not fully parametric. That is, the implementing
321320 * type is generic and the implementation is not parametrically polymorphic in all
@@ -340,9 +339,9 @@ class ImplItemNode extends ImplOrTraitItemNode instanceof Impl {
340339 pragma [ nomagic]
341340 predicate isNotFullyParametric ( ) {
342341 exists ( TypeRepr arg | arg = this .getASelfTyArg ( ) |
343- not exists ( this . getASelfTyTypeParamArg ( arg ) )
342+ not exists ( resolveTypeParamPathTypeRepr ( arg ) )
344343 or
345- this . getASelfTyTypeParamArg ( arg ) .hasTraitBound ( )
344+ resolveTypeParamPathTypeRepr ( arg ) .hasTraitBound ( )
346345 )
347346 }
348347
@@ -500,7 +499,7 @@ private class TypeParamItemNode extends ItemNode instanceof TypeParam {
500499 exists ( this .getABoundPath ( ) )
501500 or
502501 exists ( ItemNode declaringItem , WherePred wp |
503- this = resolvePath ( wp .getTypeRepr ( ) . ( PathTypeRepr ) . getPath ( ) ) and
502+ this = resolveTypeParamPathTypeRepr ( wp .getTypeRepr ( ) ) and
504503 wp = declaringItem .getADescendant ( ) and
505504 this = declaringItem .getADescendant ( )
506505 )
0 commit comments