Update lambda-improvements.md to match language design decisions#5388
Merged
cston merged 11 commits intodotnet:mainfrom Nov 9, 2021
Merged
Update lambda-improvements.md to match language design decisions#5388cston merged 11 commits intodotnet:mainfrom
cston merged 11 commits intodotnet:mainfrom
Conversation
333fred
approved these changes
Nov 8, 2021
333fred
approved these changes
Nov 8, 2021
jcouv
reviewed
Nov 9, 2021
|
|
||
| ### `var` | ||
| Lambda expressions and method groups with natural types can be used as initializers in `var` declarations. | ||
| Anonymous functions and method groups with inferred types can be used as initializers in `var` declarations. |
Member
jcouv
reviewed
Nov 9, 2021
| var f8 = F2; // System.Action<string> | ||
| ``` | ||
|
|
||
| The type of an anonymous function or method group is not inferred for implicitly-typed discards. |
Member
There was a problem hiding this comment.
Consider: "Function types are not used in assignments to discards" #Resolved
jcouv
reviewed
Nov 9, 2021
| ; | ||
| ``` | ||
|
|
||
| ## Open issues |
Member
There was a problem hiding this comment.
Haven't those open issues been resolved already?
jcouv
reviewed
Nov 9, 2021
|
|
||
| Currently, the inferred delegate type uses `System.Action<>` or `System.Func<>` when parameter and return types are valid type arguments _and_ there are no more than 16 parameters, and if the expected `Action<>` or `Func<>` type is missing, an error is reported. Instead, should the compiler use `System.Action<>` or `System.Func<>` regardless of arity? And if the expected type is missing, synthesize a delegate type otherwise? | ||
|
|
||
| ## Design meetings |
Member
There was a problem hiding this comment.
Consider moving this list to the championed issue (easier to update), or only keeping it here and updating it with latest links. #Resolved
jcouv
reviewed
Nov 9, 2021
Member
jcouv
left a comment
There was a problem hiding this comment.
Done with review pass (iteration 10)
jcouv
approved these changes
Nov 9, 2021
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.
Various updates to proposals/csharp-10.0/lambda-improvements.md to match language design decisions and C#10 implementation:
varcannot be used as an explicit return type (see 2021-06-02)object(see 2021-08-23)