@@ -295,6 +295,11 @@ abstract class ImplOrTraitItemNode extends ItemNode {
295
295
predicate hasAssocItem ( string name ) { name = this .getAnAssocItem ( ) .getName ( ) }
296
296
}
297
297
298
+ pragma [ nomagic]
299
+ private TypeParamItemNode resolveTypeParamPathTypeRepr ( PathTypeRepr ptr ) {
300
+ result = resolvePath ( ptr .getPath ( ) )
301
+ }
302
+
298
303
class ImplItemNode extends ImplOrTraitItemNode instanceof Impl {
299
304
Path getSelfPath ( ) { result = super .getSelfTy ( ) .( PathTypeRepr ) .getPath ( ) }
300
305
@@ -310,12 +315,6 @@ class ImplItemNode extends ImplOrTraitItemNode instanceof Impl {
310
315
this .getSelfPath ( ) .getPart ( ) .getGenericArgList ( ) .getAGenericArg ( ) .( TypeArg ) .getTypeRepr ( )
311
316
}
312
317
313
- pragma [ nomagic]
314
- private TypeParamItemNode getASelfTyTypeParamArg ( TypeRepr arg ) {
315
- arg = this .getASelfTyArg ( ) and
316
- result = resolvePath ( arg .( PathTypeRepr ) .getPath ( ) )
317
- }
318
-
319
318
/**
320
319
* Holds if this `impl` block is not fully parametric. That is, the implementing
321
320
* type is generic and the implementation is not parametrically polymorphic in all
@@ -340,9 +339,9 @@ class ImplItemNode extends ImplOrTraitItemNode instanceof Impl {
340
339
pragma [ nomagic]
341
340
predicate isNotFullyParametric ( ) {
342
341
exists ( TypeRepr arg | arg = this .getASelfTyArg ( ) |
343
- not exists ( this . getASelfTyTypeParamArg ( arg ) )
342
+ not exists ( resolveTypeParamPathTypeRepr ( arg ) )
344
343
or
345
- this . getASelfTyTypeParamArg ( arg ) .hasTraitBound ( )
344
+ resolveTypeParamPathTypeRepr ( arg ) .hasTraitBound ( )
346
345
)
347
346
}
348
347
@@ -500,7 +499,7 @@ private class TypeParamItemNode extends ItemNode instanceof TypeParam {
500
499
exists ( this .getABoundPath ( ) )
501
500
or
502
501
exists ( ItemNode declaringItem , WherePred wp |
503
- this = resolvePath ( wp .getTypeRepr ( ) . ( PathTypeRepr ) . getPath ( ) ) and
502
+ this = resolveTypeParamPathTypeRepr ( wp .getTypeRepr ( ) ) and
504
503
wp = declaringItem .getADescendant ( ) and
505
504
this = declaringItem .getADescendant ( )
506
505
)
0 commit comments