-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overload resolution was ignoring HasTypeArgumentInferredFromFunctionType for calls in expanded form #57633
Conversation
…ype for calls in expanded form
new MemberResolutionResult<TMember>( | ||
result.Member, | ||
result.LeastOverriddenMember, | ||
result.WithResult( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -3465,7 +3460,7 @@ internal EffectiveParameters(ImmutableArray<TypeWithAnnotations> types, Immutabl | |||
ref useSiteInfo); | |||
if (typeArguments.IsDefault) | |||
{ | |||
return new MemberResolutionResult<TMember>(member, leastOverriddenMember, inferenceError); | |||
return new MemberResolutionResult<TMember>(member, leastOverriddenMember, inferenceError, hasTypeArgumentInferredFromFunctionType: false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could although typeArguments.IsDefault
is returned for error conditions, and hasTypeArgumentsInferredFromFunctionType == false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 1)
…ype for calls in expanded form (dotnet#57633)
For calls to generic overloads with a
params
parameter, overload resolution was ignoring whether type inference relied on function types, so the "better function member" was not preferring calls with no function types.Fixes #57627.