This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
Using named parameter syntax when passing literals in System.Linq.Expressions #13046
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.
Used a Roslyn analyzer and code fix provider to find method invocations where the last 1..N arguments are
false
,true
, ornull
literals without named parameter syntax. When found, the code fix rewrites them to include the parameter name.I've applied the suggested changes pretty much everywhere, with the exception of the
Push
method in the interpreter, when we pushnull
to the evaluation stack. That's pretty clear from context given it's the only argument.I didn't want to deal with literals that occur in the middle of an argument list, to avoid worries about reordering evaluation and other complexities. I'll revisit that one day while also addressing indexers, delegate invocation, and object creation nodes.
CC @stephentoub