-
Notifications
You must be signed in to change notification settings - Fork 94
[Version 10.0] Feature support for lambda improvements #1566
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
Draft
RexJaeschke
wants to merge
9
commits into
draft-10
Choose a base branch
from
v10-lambda-improvements
base: draft-10
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2301cf2
support lambda improvements
RexJaeschke 0a4c859
support lambda improvements
RexJaeschke 5110efc
support lambda improvements
RexJaeschke 3dc7165
support lambda improvements
RexJaeschke 6dd6373
fix test example name
RexJaeschke fb4f5b3
fix formatting
RexJaeschke 539f8b2
fix formatting
RexJaeschke 00e4d9d
Address open comments in PR
BillWagner 73e7153
Add omissions from this PR
BillWagner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -156,7 +156,7 @@ | |
|
|
||
| ## 23.3 Attribute specification | ||
|
|
||
| Application of a previously defined attribute to a program entity is called ***attribute specification***. An attribute is a piece of additional declarative information that is specified for a program entity. Attributes can be specified at global scope (to specify attributes on the containing assembly or module) and for *type_declaration*s ([§14.7](namespaces.md#147-type-declarations)), *class_member_declaration*s ([§15.3](classes.md#153-class-members)), *interface_member_declaration*s ([§19.4](interfaces.md#194-interface-members)), *struct_member_declaration*s ([§16.3](structs.md#163-struct-members)), *enum_member_declaration*s ([§20.2](enums.md#202-enum-declarations)), *accessor_declaration*s ([§15.7.3](classes.md#1573-accessors)), *event_accessor_declaration*s ([§15.8](classes.md#158-events)), elements of *parameter_list*s ([§15.6.2](classes.md#1562-method-parameters)), and elements of *type_parameter_list*s ([§15.2.3](classes.md#1523-type-parameters)). | ||
| Application of a previously defined attribute to a program entity is called ***attribute specification***. An attribute is a piece of additional declarative information that is specified for a program entity. Attributes can be specified at global scope (to specify attributes on the containing assembly or module) and for *type_declaration*s ([§14.7](namespaces.md#147-type-declarations)), *class_member_declaration*s ([§15.3](classes.md#153-class-members)), *interface_member_declaration*s ([§19.4](interfaces.md#194-interface-members)), *struct_member_declaration*s ([§16.3](structs.md#163-struct-members)), *enum_member_declaration*s ([§20.2](enums.md#202-enum-declarations)), *accessor_declaration*s ([§15.7.3](classes.md#1573-accessors)), *event_accessor_declaration*s ([§15.8](classes.md#158-events)), elements of *parameter_list*s ([§15.6.2](classes.md#1562-method-parameters)), elements of *type_parameter_list*s ([§15.2.3](classes.md#1523-type-parameters)), *lambda_expression*s ([§12.22.1](expressions.md#12221-general)), and elements of *explicit_anonymous_function_parameter*s and *implicit_anonymous_function_parameter*s ([§12.22.1](expressions.md#12221-general)). | ||
|
|
||
| Attributes are specified in ***attribute section***s. An attribute section consists of a pair of square brackets, which surround a comma-separated list of one or more attributes. The order in which attributes are specified in such a list, and the order in which sections attached to the same program entity are arranged, is not significant. For instance, the attribute specifications `[A][B]`, `[B][A]`, `[A, B]`, and `[B, A]` are equivalent. | ||
|
|
||
|
|
@@ -252,10 +252,10 @@ | |
|
|
||
| - `event` — an event. | ||
| - `field` — a field. A field-like event (i.e., one without accessors) ([§15.8.2](classes.md#1582-field-like-events)) and an automatically implemented property ([§15.7.4](classes.md#1574-automatically-implemented-properties)) can also have an attribute with this target. | ||
| - `method` — a constructor; finalizer; method; operator; property get, set, and init accessors; indexer get, set, and init accessors; and event add and remove accessors. A field-like event (i.e., one without accessors) can also have an attribute with this target. | ||
| - `method` — a constructor; finalizer; method; operator; property get, set, and init accessors; indexer get, set, and init accessors; event add and remove accessors; and lambda expressions. A field-like event (i.e., one without accessors) can also have an attribute with this target. | ||
| - `param` — property set and init accessors, indexer set and init accessors, event add and remove accessors, and a parameter in a constructor, method, and operator. | ||
| - `property` — a property and an indexer. | ||
| - `return` — a delegate, method, operator, property get accessor, and indexer get accessor. | ||
| - `return` — a delegate, method, operator, property get accessor, indexer get accessor, and lambda expression. | ||
| - `type` — a delegate, class, struct, enum, and interface. | ||
| - `typevar` — a type parameter. | ||
|
|
||
|
|
@@ -285,6 +285,9 @@ | |
| - In the case of an event declaration that does not omit *event_accessor_declarations* the default target is the method. | ||
| - `method` — the target is the associated method | ||
| - `param` — the target is the lone parameter | ||
| - For an attribute on a *lambda_expression* the default target is the method. Otherwise when the *attribute_target* is equal to: | ||
| - `method` — the target is the method | ||
| - `return` — the target is the return value | ||
|
|
||
| In all other contexts, inclusion of an *attribute_target_specifier* is permitted but unnecessary. | ||
|
|
||
|
|
@@ -967,7 +970,7 @@ | |
| > ```csharp | ||
| > #nullable enable | ||
| > public class X | ||
| > { | ||
| > private void ThrowIfNull([DoesNotReturnIf(true)] bool isNull, string argumentName) | ||
| > { | ||
| > if (isNull) | ||
|
|
@@ -1193,4 +1196,4 @@ | |
| > | ||
| > *end example* | ||
|
|
||
|
|
||
|
Check failure on line 1199 in standard/attributes.md
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
The MS proposal mentions
System.MulticastDelegate. However, as we don’t have that type in our spec, I replaced all such mentions withSystem.Delegate.