@@ -1159,9 +1159,6 @@ private module ContextTyping {
11591159 inferType ( n , path ) = TUnknownType ( )
11601160 }
11611161
1162- pragma [ nomagic]
1163- private predicate hasUnknownType ( AstNode n ) { hasUnknownTypeAt ( n , _) }
1164-
11651162 signature Type inferCallTypeSig ( AstNode n , boolean isReturn , TypePath path ) ;
11661163
11671164 /**
@@ -1172,24 +1169,21 @@ private module ContextTyping {
11721169 */
11731170 module CheckContextTyping< inferCallTypeSig / 3 inferCallType> {
11741171 pragma [ nomagic]
1175- private Type inferCallTypeFromContextCand ( AstNode n , TypePath path , TypePath prefix ) {
1176- result = inferCallType ( n , false , path ) and
1177- hasUnknownType ( n ) and
1178- prefix = path
1179- or
1180- exists ( TypePath mid |
1181- result = inferCallTypeFromContextCand ( n , path , mid ) and
1182- mid .isSnoc ( prefix , _)
1183- )
1184- }
1172+ Type inferCallNonReturnType ( AstNode n , TypePath path ) { result = inferCallType ( n , false , path ) }
11851173
11861174 pragma [ nomagic]
11871175 Type check ( AstNode n , TypePath path ) {
11881176 result = inferCallType ( n , true , path )
11891177 or
1190- exists ( TypePath prefix |
1191- result = inferCallTypeFromContextCand ( n , path , prefix ) and
1192- hasUnknownTypeAt ( n , prefix )
1178+ exists ( Type t , TypePath path0 |
1179+ t = inferCallNonReturnType ( n , path0 ) and
1180+ hasUnknownTypeAt ( n , path0 )
1181+ |
1182+ result = t and
1183+ path = path0
1184+ or
1185+ result = TUnknownType ( ) and
1186+ path = path0 .append ( TypePath:: singleton ( t .getATypeParameter ( ) ) )
11931187 )
11941188 }
11951189 }
@@ -2669,9 +2663,8 @@ private module NonMethodResolution {
26692663 then
26702664 // We only check that the context of the call provides relevant type information
26712665 // when no argument can
2672- not exists ( FunctionPosition pos0 |
2673- FunctionOverloading:: traitTypeParameterOccurrence ( trait , traitFunction , _, pos0 , _, _) and
2674- not pos0 .isReturn ( )
2666+ not exists ( FunctionPosition pos0 | not pos0 .isReturn ( ) |
2667+ FunctionOverloading:: traitTypeParameterOccurrence ( trait , traitFunction , _, pos0 , _, _)
26752668 or
26762669 FunctionOverloading:: functionResolutionDependsOnArgument ( impl , implFunction , pos0 , _, _)
26772670 )
@@ -2837,7 +2830,7 @@ private module NonMethodResolution {
28372830 NonMethodFunction resolveTraitFunctionViaPathResolution ( TraitItemNode trait ) {
28382831 this .hasTrait ( ) and
28392832 result = this .getPathResolutionResolved ( ) and
2840- result = trait .getASuccessor ( _ )
2833+ result = trait .getAnAssocItem ( )
28412834 }
28422835 }
28432836
0 commit comments