@@ -450,11 +450,9 @@ private module Input3 implements InputSig3 {
450450 }
451451
452452 bindingset [ derefChainBorrow]
453- Type inferCallArgumentType ( Call call , string derefChainBorrow , int i , TypePath path ) {
454- exists ( FunctionPosition pos |
455- i = pos .asPosition ( ) and
456- result = call .( FunctionCallMatchingInput:: Access ) .getInferredType ( derefChainBorrow , pos , path )
457- )
453+ Type inferCallArgumentType ( Call call , string derefChainBorrow , int pos , TypePath path ) {
454+ result =
455+ call .( FunctionCallMatchingInput:: Access ) .getInferredArgumentType ( derefChainBorrow , pos , path )
458456 }
459457
460458 Type inferCallArgumentType ( AstNode n , TypePath path ) {
@@ -1039,9 +1037,6 @@ private class NonAssocCallExpr extends CallExpr {
10391037
10401038 pragma [ nomagic]
10411039 Type getInferredType ( FunctionPosition pos , TypePath path ) {
1042- pos .isTypeQualifier ( ) and
1043- result = getCallExprTypeQualifier ( this , path , false )
1044- or
10451040 result = inferType ( this .getNodeAt ( pos ) , path )
10461041 }
10471042}
@@ -2587,7 +2582,7 @@ private module AssocFunctionResolution {
25872582 * A matching configuration for resolving types of function call expressions
25882583 * like `foo.bar(baz)` and `Foo::bar(baz)`.
25892584 */
2590- private module FunctionCallMatchingInput implements MatchingWithEnvironmentInputSig {
2585+ private module FunctionCallMatchingInput {
25912586 import FunctionPositionMatchingInput
25922587
25932588 private newtype TDeclaration =
@@ -2681,9 +2676,7 @@ private module FunctionCallMatchingInput implements MatchingWithEnvironmentInput
26812676 }
26822677
26832678 bindingset [ derefChainBorrow]
2684- additional predicate decodeDerefChainBorrow (
2685- string derefChainBorrow , DerefChain derefChain , BorrowKind borrow
2686- ) {
2679+ predicate decodeDerefChainBorrow ( string derefChainBorrow , DerefChain derefChain , BorrowKind borrow ) {
26872680 exists ( int i |
26882681 i = derefChainBorrow .indexOf ( ";" ) and
26892682 derefChain = derefChainBorrow .prefix ( i ) and
@@ -2704,8 +2697,10 @@ private module FunctionCallMatchingInput implements MatchingWithEnvironmentInput
27042697 abstract private class AccessImpl extends ContextTyping:: ContextTypedCallCand {
27052698 abstract AstNode getNodeAt ( FunctionPosition pos ) ;
27062699
2700+ // bindingset[derefChainBorrow]
2701+ // abstract Type getInferredType(string derefChainBorrow, FunctionPosition pos, TypePath path);
27072702 bindingset [ derefChainBorrow]
2708- abstract Type getInferredType ( string derefChainBorrow , FunctionPosition pos , TypePath path ) ;
2703+ abstract Type getInferredArgumentType ( string derefChainBorrow , int pos , TypePath path ) ;
27092704
27102705 abstract Declaration getTarget ( string derefChainBorrow ) ;
27112706
@@ -2740,22 +2735,26 @@ private module FunctionCallMatchingInput implements MatchingWithEnvironmentInput
27402735 }
27412736
27422737 pragma [ nomagic]
2743- private Type getInferredSelfType ( FunctionPosition pos , string derefChainBorrow , TypePath path ) {
2744- exists ( DerefChain derefChain , BorrowKind borrow |
2745- result = super .getSelfTypeAt ( pos , derefChain , borrow , path ) and
2738+ private Type getInferredSelfType ( int pos , string derefChainBorrow , TypePath path ) {
2739+ exists ( FunctionPosition fpos , DerefChain derefChain , BorrowKind borrow |
2740+ result = super .getSelfTypeAt ( fpos , derefChain , borrow , path ) and
27462741 derefChainBorrow = encodeDerefChainBorrow ( derefChain , borrow ) and
2747- super .hasReceiverAtPos ( pos )
2742+ super .hasReceiverAtPos ( fpos ) and
2743+ pos = fpos .asPosition ( )
27482744 )
27492745 }
27502746
27512747 pragma [ nomagic]
2752- private Type getInferredNonSelfType ( FunctionPosition pos , TypePath path ) {
2753- not super .hasReceiverAtPos ( pos ) and
2754- result = super .getTypeAt ( pos , path )
2748+ private Type getInferredNonSelfType ( int pos , TypePath path ) {
2749+ exists ( FunctionPosition fpos |
2750+ not super .hasReceiverAtPos ( fpos ) and
2751+ result = super .getTypeAt ( fpos , path ) and
2752+ pos = fpos .asPosition ( )
2753+ )
27552754 }
27562755
27572756 bindingset [ derefChainBorrow]
2758- override Type getInferredType ( string derefChainBorrow , FunctionPosition pos , TypePath path ) {
2757+ override Type getInferredArgumentType ( string derefChainBorrow , int pos , TypePath path ) {
27592758 result = this .getInferredSelfType ( pos , derefChainBorrow , path )
27602759 or
27612760 result = this .getInferredNonSelfType ( pos , path )
@@ -2811,14 +2810,17 @@ private module FunctionCallMatchingInput implements MatchingWithEnvironmentInput
28112810 }
28122811
28132812 pragma [ nomagic]
2814- private Type getInferredType ( FunctionPosition pos , TypePath path ) {
2815- result = super .getInferredType ( pos , path )
2813+ private Type getInferredArgumentType ( int pos , TypePath path ) {
2814+ exists ( FunctionPosition fpos |
2815+ result = super .getInferredType ( fpos , path ) and
2816+ pos = fpos .asPosition ( )
2817+ )
28162818 }
28172819
28182820 bindingset [ derefChainBorrow]
2819- override Type getInferredType ( string derefChainBorrow , FunctionPosition pos , TypePath path ) {
2821+ override Type getInferredArgumentType ( string derefChainBorrow , int pos , TypePath path ) {
28202822 exists ( derefChainBorrow ) and
2821- result = this .getInferredType ( pos , path )
2823+ result = this .getInferredArgumentType ( pos , path )
28222824 }
28232825
28242826 pragma [ nomagic]
0 commit comments