Ensure local function invocations and method references always have null receivers#56395
Draft
333fred wants to merge 1 commit intodotnet:mainfrom
Draft
Ensure local function invocations and method references always have null receivers#56395333fred wants to merge 1 commit intodotnet:mainfrom
333fred wants to merge 1 commit intodotnet:mainfrom
Conversation
…ull receivers Fixes dotnet#51715.
Member
Author
|
@AlekseyTs, so it turns out that the IDE is depending on the current behavior of IOperation here, as the bootstrap build is now failing. |
Contributor
It feels like that (IDE) should be fixed. |
AlekseyTs
reviewed
Sep 16, 2021
|
|
||
| // Local functions are not invoked on receivers from a language point of view, and thus we do not expose | ||
| // a receiver for them. | ||
| if (symbol is MethodSymbol { MethodKind: MethodKind.LocalFunction }) |
Contributor
Contributor
There was a problem hiding this comment.
I guess we are doing this for regular static methods too
AlekseyTs
reviewed
Sep 16, 2021
| [Theory, WorkItem(51715, "https://github.com/dotnet/roslyn/issues/51715")] | ||
| [InlineData("static")] | ||
| [InlineData("")] | ||
| public void Invocation_LocalFunction_01(string modifier) |
Contributor
AlekseyTs
reviewed
Sep 16, 2021
| } | ||
|
|
||
| [Fact, WorkItem(51715, "https://github.com/dotnet/roslyn/issues/51715")] | ||
| public void MethodReference_LocalFunction_01() |
Contributor
There was a problem hiding this comment.
Same comment as for the invocation tests.
AlekseyTs
approved these changes
Sep 16, 2021
Contributor
AlekseyTs
left a comment
There was a problem hiding this comment.
LGTM (commit 1), modulo suggested additional tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #51715.