@@ -859,7 +859,7 @@ private module StructExprMatchingInput implements MatchingInputSig {
859859
860860 pragma [ nomagic]
861861 Type getTypeArgument ( TypeArgumentPosition apos , TypePath path ) {
862- // Handle constructions that use `Self{...}` syntax
862+ // Handle constructions that use `Self {...}` syntax
863863 exists ( TypeMention tm , TypePath path0 |
864864 tm = this .getStructPath ( ) and
865865 result = tm .resolveTypeAt ( path0 ) and
@@ -872,7 +872,7 @@ private module StructExprMatchingInput implements MatchingInputSig {
872872 * be inferred from the context.
873873 */
874874 pragma [ nomagic]
875- predicate isContextTypedAt ( DeclarationPosition pos , TypePath path ) {
875+ predicate hasUnknownTypeAt ( DeclarationPosition pos , TypePath path ) {
876876 exists ( Declaration d , TypeParameter tp |
877877 d = this .getTarget ( ) and
878878 pos .isStructPos ( ) and
@@ -939,8 +939,8 @@ private Type inferStructExprType0(AstNode n, boolean isReturn, TypePath path) {
939939 |
940940 result = StructExprMatching:: inferAccessType ( a , apos , path )
941941 or
942- a .isContextTypedAt ( apos , path ) and
943- result = TContextType ( )
942+ a .hasUnknownTypeAt ( apos , path ) and
943+ result = TUnknownType ( )
944944 )
945945}
946946
@@ -1022,7 +1022,7 @@ private module ContextTyping {
10221022 * at `pos` and `path` may have to be inferred from the context.
10231023 */
10241024 bindingset [ this , i, target]
1025- predicate isContextTypedAt (
1025+ predicate hasUnknownTypeAt (
10261026 ImplOrTraitItemNode i , Function target , FunctionPosition pos , TypePath path
10271027 ) {
10281028 exists ( TypeParameter tp |
@@ -1045,10 +1045,12 @@ private module ContextTyping {
10451045 }
10461046
10471047 pragma [ nomagic]
1048- private predicate isContextTyped ( AstNode n , TypePath path ) { inferType ( n , path ) = TContextType ( ) }
1048+ private predicate hasUnknownTypeAt ( AstNode n , TypePath path ) {
1049+ inferType ( n , path ) = TUnknownType ( )
1050+ }
10491051
10501052 pragma [ nomagic]
1051- private predicate isContextTyped ( AstNode n ) { isContextTyped ( n , _) }
1053+ private predicate hasUnknownType ( AstNode n ) { hasUnknownTypeAt ( n , _) }
10521054
10531055 signature Type inferCallTypeSig ( AstNode n , boolean isReturn , TypePath path ) ;
10541056
@@ -1062,7 +1064,7 @@ private module ContextTyping {
10621064 pragma [ nomagic]
10631065 private Type inferCallTypeFromContextCand ( AstNode n , TypePath path , TypePath prefix ) {
10641066 result = inferCallType ( n , false , path ) and
1065- isContextTyped ( n ) and
1067+ hasUnknownType ( n ) and
10661068 prefix = path
10671069 or
10681070 exists ( TypePath mid |
@@ -1077,7 +1079,7 @@ private module ContextTyping {
10771079 or
10781080 exists ( TypePath prefix |
10791081 result = inferCallTypeFromContextCand ( n , path , prefix ) and
1080- isContextTyped ( n , prefix )
1082+ hasUnknownTypeAt ( n , prefix )
10811083 )
10821084 }
10831085 }
@@ -1744,7 +1746,7 @@ private module MethodResolution {
17441746 Type getTypeAt ( TypePath path ) {
17451747 result = mc_ .getACandidateReceiverTypeAtSubstituteLookupTraits ( derefChain , borrow , path ) and
17461748 not result = TNeverType ( ) and
1747- not result = TContextType ( )
1749+ not result = TUnknownType ( )
17481750 }
17491751
17501752 pragma [ nomagic]
@@ -2160,9 +2162,9 @@ private module MethodCallMatchingInput implements MatchingWithEnvironmentInputSi
21602162 * from the context.
21612163 */
21622164 pragma [ nomagic]
2163- predicate isContextTypedAt ( string derefChainBorrow , FunctionPosition pos , TypePath path ) {
2165+ predicate hasUnknownTypeAt ( string derefChainBorrow , FunctionPosition pos , TypePath path ) {
21642166 exists ( ImplOrTraitItemNode i |
2165- this .isContextTypedAt ( i , this .getTarget ( i , derefChainBorrow ) , pos , path )
2167+ this .hasUnknownTypeAt ( i , this .getTarget ( i , derefChainBorrow ) , pos , path )
21662168 )
21672169 }
21682170 }
@@ -2180,8 +2182,8 @@ private Type inferMethodCallType0(
21802182 (
21812183 result = MethodCallMatching:: inferAccessType ( a , derefChainBorrow , apos , path0 )
21822184 or
2183- a .isContextTypedAt ( derefChainBorrow , apos , path0 ) and
2184- result = TContextType ( )
2185+ a .hasUnknownTypeAt ( derefChainBorrow , apos , path0 ) and
2186+ result = TUnknownType ( )
21852187 )
21862188 |
21872189 if
@@ -2669,9 +2671,9 @@ private module NonMethodCallMatchingInput implements MatchingInputSig {
26692671 * from the context.
26702672 */
26712673 pragma [ nomagic]
2672- predicate isContextTypedAt ( FunctionPosition pos , TypePath path ) {
2674+ predicate hasUnknownTypeAt ( FunctionPosition pos , TypePath path ) {
26732675 exists ( ImplOrTraitItemNode i |
2674- this .isContextTypedAt ( i ,
2676+ this .hasUnknownTypeAt ( i ,
26752677 [
26762678 this .resolveCallTargetViaPathResolution ( ) .( NonMethodFunction ) ,
26772679 this .resolveCallTargetViaTypeInference ( i ) ,
@@ -2705,8 +2707,8 @@ private Type inferNonMethodCallType0(AstNode n, boolean isReturn, TypePath path)
27052707 |
27062708 result = NonMethodCallMatching:: inferAccessType ( a , apos , path )
27072709 or
2708- a .isContextTypedAt ( apos , path ) and
2709- result = TContextType ( )
2710+ a .hasUnknownTypeAt ( apos , path ) and
2711+ result = TUnknownType ( )
27102712 )
27112713}
27122714
0 commit comments