@@ -434,7 +434,7 @@ private module Input3 implements InputSig3 {
434434 }
435435
436436 bindingset [ derefChainBorrow]
437- Type inferCallTypeBottomUp ( Call call , string derefChainBorrow , FunctionPosition pos , TypePath path ) {
437+ Type inferCallTypeAtPos ( Call call , string derefChainBorrow , FunctionPosition pos , TypePath path ) {
438438 result = call .( FunctionCallMatchingInput:: Access ) .getInferredType ( derefChainBorrow , pos , path )
439439 }
440440
@@ -450,14 +450,14 @@ private module Input3 implements InputSig3 {
450450 )
451451 }
452452
453- Type inferCallArgumentTypeTopDown ( AstNode n , TypePath path ) {
453+ Type inferCallArgumentType ( AstNode n , TypePath path ) {
454454 exists ( FunctionCallMatchingInput:: Access call , FunctionPosition pos |
455- result = inferCallArgumentTypeTopDown ( call , pos , n , _, _, path ) and
455+ result = inferCallArgumentType ( call , pos , n , _, _, path ) and
456456 not call .( AssocFunctionResolution:: AssocFunctionCall ) .hasReceiverAtPos ( pos )
457457 )
458458 or
459459 exists ( FunctionCallMatchingInput:: Access a |
460- result = inferFunctionCallSelfArgumentTypeTopDown ( a , n , DerefChain:: nil ( ) , path ) and
460+ result = inferFunctionCallSelfArgumentType ( a , n , DerefChain:: nil ( ) , path ) and
461461 if a .( AssocFunctionResolution:: AssocFunctionCall ) .hasReceiver ( )
462462 then not path .isEmpty ( )
463463 else any ( )
@@ -623,20 +623,6 @@ private module Input3 implements InputSig3 {
623623 )
624624 }
625625
626- Type inferTypeTopDown ( AstNode n , TypePath path ) {
627- result = inferTypeFromAnnotationTopDown ( n , path )
628- or
629- result = inferClosureExprBodyTypeTopDown ( n , path )
630- or
631- exists ( FunctionPosition pos | not pos .isReturn ( ) |
632- result = inferConstructionType ( n , pos , path )
633- or
634- result = inferOperationType ( n , pos , path )
635- )
636- or
637- result = inferFieldExprType ( n , path , true )
638- }
639-
640626 Type inferType ( AstNode n , TypePath path ) {
641627 result = M3:: inferType ( n , path )
642628 or
@@ -672,6 +658,20 @@ private module Input3 implements InputSig3 {
672658 or
673659 result = inferUnknownType ( n , path )
674660 }
661+
662+ Type inferTypeTopDown ( AstNode n , TypePath path ) {
663+ result = inferTypeFromAnnotationTopDown ( n , path )
664+ or
665+ result = inferClosureExprBodyTypeTopDown ( n , path )
666+ or
667+ exists ( FunctionPosition pos | not pos .isReturn ( ) |
668+ result = inferConstructionType ( n , pos , path )
669+ or
670+ result = inferOperationType ( n , pos , path )
671+ )
672+ or
673+ result = inferFieldExprType ( n , path , true )
674+ }
675675}
676676
677677private module M3 = Make3< Input3 > ;
@@ -2827,13 +2827,13 @@ private module FunctionCallMatchingInput implements MatchingWithEnvironmentInput
28272827}
28282828
28292829pragma [ nomagic]
2830- private Type inferCallArgumentTypeTopDown (
2830+ private Type inferCallArgumentType (
28312831 FunctionCallMatchingInput:: Access call , FunctionPosition pos , AstNode n , DerefChain derefChain ,
28322832 BorrowKind borrow , TypePath path
28332833) {
28342834 exists ( string derefChainBorrow |
28352835 FunctionCallMatchingInput:: decodeDerefChainBorrow ( derefChainBorrow , derefChain , borrow ) and
2836- result = M3:: inferCallArgumentTypeTopDown ( call , derefChainBorrow , pos , n , path )
2836+ result = M3:: inferCallArgumentType ( call , derefChainBorrow , pos , n , path )
28372837 )
28382838}
28392839
@@ -2845,12 +2845,12 @@ private Type inferCallArgumentTypeTopDown(
28452845 * empty, at which point the inferred type can be applied back to `n`.
28462846 */
28472847pragma [ nomagic]
2848- private Type inferFunctionCallSelfArgumentTypeTopDown (
2848+ private Type inferFunctionCallSelfArgumentType (
28492849 FunctionCallMatchingInput:: Access call , AstNode n , DerefChain derefChain , TypePath path
28502850) {
28512851 exists ( FunctionPosition pos , BorrowKind borrow , TypePath path0 |
28522852 call .( AssocFunctionResolution:: AssocFunctionCall ) .hasReceiverAtPos ( pos ) and
2853- result = inferCallArgumentTypeTopDown ( call , pos , n , derefChain , borrow , path0 )
2853+ result = inferCallArgumentType ( call , pos , n , derefChain , borrow , path0 )
28542854 |
28552855 borrow .isNoBorrow ( ) and
28562856 path = path0
@@ -2867,7 +2867,7 @@ private Type inferFunctionCallSelfArgumentTypeTopDown(
28672867 DerefChain derefChain0 , Type t0 , TypePath path0 , DerefImplItemNode impl , Type selfParamType ,
28682868 TypePath selfPath
28692869 |
2870- t0 = inferFunctionCallSelfArgumentTypeTopDown ( call , n , derefChain0 , path0 ) and
2870+ t0 = inferFunctionCallSelfArgumentType ( call , n , derefChain0 , path0 ) and
28712871 derefChain0 .isCons ( impl , derefChain ) and
28722872 selfParamType = impl .resolveSelfTypeAt ( selfPath )
28732873 |
0 commit comments