-
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
Consider extension receiver conversion when reducing #73762
Consider extension receiver conversion when reducing #73762
Conversation
var d1Access = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>() | ||
.First(s => s.Expression.ToString() == "a"); | ||
var lookupResult = model.LookupSymbols(d1Access.Name.SpanStart, aSymbol.Type, "M", includeReducedExtensionMethods: true); | ||
AssertEx.Equal("System.Int32 System.Span<System.Int32>.M(System.Int32 y)", lookupResult.Single().ToTestDisplayString()); |
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.
Without the product change
- the error messages would be that the extension method is not applicable (CS1929) rather than that Span cannot be a delegate receiver (CS1113) - but that's just different diagnostics, so probably not very interesting
- however also this LookupSymbols would not be able to find the method
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.
FWIW, it looks like we'll report "error CS8917: The delegate type could not be inferred" rather than "error CS1113: Extension method ... cannot be used to create delegates" if the ReducedExtensionMethodSymbol
change is removed.
f8a481c
to
2ff45e6
Compare
Test plan: #73445