@@ -525,7 +525,7 @@ private module Input3 implements InputSig3 {
525525 final class Invocation = InvocationImpl ;
526526
527527 abstract private class InvocationImpl extends Expr {
528- abstract TypeMention getTypeQualifier ( ) ;
528+ abstract Type getTypeQualifier ( TypePath path ) ;
529529
530530 abstract Type getTypeArgument ( int pos , TypePath path ) ;
531531
@@ -542,7 +542,9 @@ private module Input3 implements InputSig3 {
542542
543543 private class AssocFunctionCall extends InvocationImpl instanceof AssocFunctionResolution:: AssocFunctionCall
544544 {
545- override TypeMention getTypeQualifier ( ) { result = getCallExprTypeArgument2 ( this ) }
545+ override Type getTypeQualifier ( TypePath path ) {
546+ result = getCallExprTypeQualifier ( this , path , _)
547+ }
546548
547549 pragma [ nomagic]
548550 override Type getTypeArgument ( int pos , TypePath path ) {
@@ -589,7 +591,7 @@ private module Input3 implements InputSig3 {
589591 private class NonAssocFunctionCall extends InvocationImpl instanceof NonAssocCallExpr ,
590592 CallExprImpl:: CallExprCall
591593 {
592- override TypeMention getTypeQualifier ( ) { none ( ) }
594+ override Type getTypeQualifier ( TypePath path ) { none ( ) }
593595
594596 pragma [ nomagic]
595597 override Type getTypeArgument ( int pos , TypePath path ) {
@@ -627,7 +629,9 @@ private module Input3 implements InputSig3 {
627629 this instanceof CallExprImpl:: TupleVariantExpr
628630 }
629631
630- override TypeMention getTypeQualifier ( ) { result = CallExprImpl:: getFunctionPath ( this ) }
632+ override Type getTypeQualifier ( TypePath path ) {
633+ result = CallExprImpl:: getFunctionPath ( this ) .( TypeMention ) .getTypeAt ( path )
634+ }
631635
632636 override Type getTypeArgument ( int pos , TypePath path ) {
633637 // result = NonAssocCallExpr.super.getTypeArgument(pos, path)
@@ -648,9 +652,9 @@ private module Input3 implements InputSig3 {
648652 pragma [ nomagic]
649653 override Constructor getTarget ( ) { result = resolvePath ( super .getPath ( ) ) }
650654
651- override TypeMention getTypeQualifier ( ) {
655+ override Type getTypeQualifier ( TypePath path ) {
652656 // Handle constructions that use `Self {...}` syntax
653- result = super .getPath ( )
657+ result = super .getPath ( ) . ( TypeMention ) . getTypeAt ( path )
654658 }
655659
656660 pragma [ nomagic]
@@ -1149,25 +1153,6 @@ private Type getCallExprTypeArgument(CallExpr ce, int pos, TypePath path) {
11491153 )
11501154}
11511155
1152- pragma [ nomagic]
1153- private TypeMention getCallExprTypeArgument2 ( CallExpr ce ) {
1154- exists ( Path p | p = CallExprImpl:: getFunctionPath ( ce ) |
1155- exists ( Path qualifier |
1156- qualifier = p .getQualifier ( ) and
1157- not result .getType ( ) instanceof TraitType
1158- |
1159- result = qualifier
1160- or
1161- // `<Foo as Bar>::baz()`; `Foo` is the type qualifier
1162- exists ( PathSegment segment |
1163- segment = qualifier .getSegment ( ) and
1164- result = segment .getTypeRepr ( ) and
1165- segment .hasTraitTypeRepr ( )
1166- )
1167- )
1168- )
1169- }
1170-
11711156/**
11721157 * Holds if `me` is a call to the `panic!` macro.
11731158 *
0 commit comments