Skip to content

Commit 5d54bf5

Browse files
[create-pull-request] automated change (#1346)
Co-authored-by: BillWagner <[email protected]>
1 parent 976145d commit 5d54bf5

File tree

8 files changed

+80
-77
lines changed

8 files changed

+80
-77
lines changed

standard/README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@
472472
- [§13.9.3](statements.md#1393-the-do-statement) The do statement
473473
- [§13.9.4](statements.md#1394-the-for-statement) The for statement
474474
- [§13.9.5](statements.md#1395-the-foreach-statement) The foreach statement
475+
- [§13.9.5.1](statements.md#13951-general) General
476+
- [§13.9.5.2](statements.md#13952-synchronous-foreach) Synchronous foreach
477+
- [§13.9.5.3](statements.md#13953-await-foreach) await foreach
475478
- [§13.10](statements.md#1310-jump-statements) Jump statements
476479
- [§13.10.1](statements.md#13101-general) General
477480
- [§13.10.2](statements.md#13102-the-break-statement) The break statement
@@ -605,24 +608,24 @@
605608
- [§15.11.5](classes.md#15115-default-constructors) Default constructors
606609
- [§15.12](classes.md#1512-static-constructors) Static constructors
607610
- [§15.13](classes.md#1513-finalizers) Finalizers
608-
- [§15.14](classes.md#1514-iterators) Iterators
611+
- [§15.14](classes.md#1514-async-functions) Async Functions
609612
- [§15.14.1](classes.md#15141-general) General
610-
- [§15.14.2](classes.md#15142-enumerator-interfaces) Enumerator interfaces
611-
- [§15.14.3](classes.md#15143-enumerable-interfaces) Enumerable interfaces
612-
- [§15.14.4](classes.md#15144-yield-type) Yield type
613-
- [§15.14.5](classes.md#15145-enumerator-objects) Enumerator objects
614-
- [§15.14.5.1](classes.md#151451-general) General
615-
- [§15.14.5.2](classes.md#151452-the-movenext-method) The MoveNext method
616-
- [§15.14.5.3](classes.md#151453-the-current-property) The Current property
617-
- [§15.14.5.4](classes.md#151454-the-dispose-method) The Dispose method
618-
- [§15.14.6](classes.md#15146-enumerable-objects) Enumerable objects
619-
- [§15.14.6.1](classes.md#151461-general) General
620-
- [§15.14.6.2](classes.md#151462-the-getenumerator-method) The GetEnumerator method
621-
- [§15.15](classes.md#1515-async-functions) Async Functions
613+
- [§15.14.2](classes.md#15142-task-type-builder-pattern) Task-type builder pattern
614+
- [§15.14.3](classes.md#15143-evaluation-of-a-task-returning-async-function) Evaluation of a task-returning async function
615+
- [§15.14.4](classes.md#15144-evaluation-of-a-void-returning-async-function) Evaluation of a void-returning async function
616+
- [§15.15](classes.md#1515-synchronous-and-asynchronous-iterators) Synchronous and asynchronous iterators
622617
- [§15.15.1](classes.md#15151-general) General
623-
- [§15.15.2](classes.md#15152-task-type-builder-pattern) Task-type builder pattern
624-
- [§15.15.3](classes.md#15153-evaluation-of-a-task-returning-async-function) Evaluation of a task-returning async function
625-
- [§15.15.4](classes.md#15154-evaluation-of-a-void-returning-async-function) Evaluation of a void-returning async function
618+
- [§15.15.2](classes.md#15152-enumerator-interfaces) Enumerator interfaces
619+
- [§15.15.3](classes.md#15153-enumerable-interfaces) Enumerable interfaces
620+
- [§15.15.4](classes.md#15154-yield-type) Yield type
621+
- [§15.15.5](classes.md#15155-enumerator-objects) Enumerator objects
622+
- [§15.15.5.1](classes.md#151551-general) General
623+
- [§15.15.5.2](classes.md#151552-advance-the-enumerator) Advance the enumerator
624+
- [§15.15.5.3](classes.md#151553-retrieve-the-current-value) Retrieve the current value
625+
- [§15.15.5.4](classes.md#151554-dispose-of-resources) Dispose of resources
626+
- [§15.15.6](classes.md#15156-enumerable-objects) Enumerable objects
627+
- [§15.15.6.1](classes.md#151561-general) General
628+
- [§15.15.6.2](classes.md#151562-the-getenumerator-or-getasyncenumerator-method) The GetEnumerator or GetAsyncEnumerator method
626629
- [§16](structs.md#16-structs) Structs
627630
- [§16.1](structs.md#161-general) General
628631
- [§16.2](structs.md#162-struct-declarations) Struct declarations

standard/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ If a program uses a type or member that is decorated with the `Obsolete` attribu
775775
776776
### 22.5.5 The AsyncMethodBuilder attribute
777777
778-
This attribute is described in [§15.15.1](classes.md#15151-general).
778+
This attribute is described in [§15.14.1](classes.md#15141-general).
779779
780780
### 22.5.6 Caller-info attributes
781781

standard/classes.md

Lines changed: 29 additions & 29 deletions
Large diffs are not rendered by default.

standard/conversions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,9 @@ Specifically, an anonymous function `F` is compatible with a delegate type `D`
760760
- If `F` does not contain an *anonymous_function_signature*, then `D` may have zero or more parameters of any type, as long as no parameter of `D` is an output parameter.
761761
- If `F` has an explicitly typed parameter list, each parameter in `D` has the same modifiers as the corresponding parameter in `F` and an identity conversion exists between the corresponding parameter in `F`.
762762
- If `F` has an implicitly typed parameter list, `D` has no reference or output parameters.
763-
- If the body of `F` is an expression, and *either* `D` has a void return type *or* `F` is async and `D` has aTaskType»` return type ([§15.15.1](classes.md#15151-general)), then when each parameter of `F` is given the type of the corresponding parameter in `D`, the body of `F` is a valid expression (w.r.t [§12](expressions.md#12-expressions)) that would be permitted as a *statement_expression* ([§13.7](statements.md#137-expression-statements)).
763+
- If the body of `F` is an expression, and *either* `D` has a void return type *or* `F` is async and `D` has aTaskType»` return type ([§15.14.1](classes.md#15141-general)), then when each parameter of `F` is given the type of the corresponding parameter in `D`, the body of `F` is a valid expression (w.r.t [§12](expressions.md#12-expressions)) that would be permitted as a *statement_expression* ([§13.7](statements.md#137-expression-statements)).
764764
- If the body of `F` is a block, and *either* `D` has a void return type *or* `F` is async and `D` has aTaskType»` return type , then when each parameter of `F` is given the type of the corresponding parameter in `D`, the body of `F` is a valid block (w.r.t [§13.3](statements.md#133-blocks)) in which no `return` statement specifies an expression.
765-
- If the body of `F` is an expression, and *either* `F` is non-async and `D` has a non-`void` return type `T`, *or* `F` is async and `D` has aTaskType»<T>` return type ([§15.15.1](classes.md#15151-general)), then when each parameter of `F` is given the type of the corresponding parameter in `D`, the body of `F` is a valid expression (w.r.t [§12](expressions.md#12-expressions)) that is implicitly convertible to `T`.
765+
- If the body of `F` is an expression, and *either* `F` is non-async and `D` has a non-`void` return type `T`, *or* `F` is async and `D` has aTaskType»<T>` return type ([§15.14.1](classes.md#15141-general)), then when each parameter of `F` is given the type of the corresponding parameter in `D`, the body of `F` is a valid expression (w.r.t [§12](expressions.md#12-expressions)) that is implicitly convertible to `T`.
766766
- If the body of `F` is a block, and *either* `F` is non-async and `D` has a non-void return type `T`, *or* `F` is async and `D` has aTaskType»<T>` return type, then when each parameter of `F` is given the type of the corresponding parameter in `D`, the body of `F` is a valid statement block (w.r.t [§13.3](statements.md#133-blocks)) with a non-reachable end point in which each return statement specifies an expression that is implicitly convertible to `T`.
767767
768768
> *Example*: The following examples illustrate these rules:

standard/expressions.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,8 @@ The ***inferred effective return type*** is determined as follows:
886886
887887
The ***inferred return type*** is determined as follows:
888888
889-
- If `F` is async and the body of `F` is either an expression classified as nothing ([§12.2](expressions.md#122-expression-classifications)), or a block where no `return` statements have expressions, the inferred return type isTaskType»` ([§15.15.1](classes.md#15151-general)).
890-
- If `F` is async and has an inferred effective return type `T`, the inferred return type isTaskType»<T>»`([§15.15.1](classes.md#15151-general)).
889+
- If `F` is async and the body of `F` is either an expression classified as nothing ([§12.2](expressions.md#122-expression-classifications)), or a block where no `return` statements have expressions, the inferred return type isTaskType»` ([§15.14.1](classes.md#15141-general)).
890+
- If `F` is async and has an inferred effective return type `T`, the inferred return type isTaskType»<T>»`([§15.14.1](classes.md#15141-general)).
891891
- If `F` is non-async and has an inferred effective return type `T`, the inferred return type is `T`.
892892
- Otherwise, a return type cannot be inferred for `F`.
893893
@@ -1118,7 +1118,7 @@ Given an expression `E` and a type `T`, `E` ***exactly matches*** `T` if one of
11181118
- `E` is an anonymous function, `T` is either a delegate type `D` or an expression tree type `Expression<D>` and one of the following holds:
11191119
- An inferred return type `X` exists for `E` in the context of the parameter list of `D` ([§12.6.3.12](expressions.md#126312-fixing)), and an identity conversion exists from `X` to the return type of `D`
11201120
- `E` is an `async` lambda with no return value, and `D` has a return type which is a non-genericTaskType»`
1121-
- Either `E` is non-async and `D` has a return type `Y` or `E` is async and `D` has a return typeTaskType»<Y>`([§15.15.1](classes.md#15151-general)), and one of the following holds:
1121+
- Either `E` is non-async and `D` has a return type `Y` or `E` is async and `D` has a return typeTaskType»<Y>`([§15.14.1](classes.md#15141-general)), and one of the following holds:
11221122
- The body of `E` is an expression that exactly matches `Y`
11231123
- The body of `E` is a block where every return statement returns an expression that exactly matches `Y`
11241124
@@ -1127,8 +1127,8 @@ Given an expression `E` and a type `T`, `E` ***exactly matches*** `T` if one of
11271127
Given two types `T₁` and `T₂`, `T₁` is a ***better conversion target*** than `T₂` if one of the following holds:
11281128
11291129
- An implicit conversion from `T₁` to `T₂` exists and no implicit conversion from `T₂` to `T₁` exists
1130-
- `T₁` isTaskType»<S₁>`([§15.15.1](classes.md#15151-general)), `T₂` isTaskType»<S₂>`, and `S₁` is a better conversion target than `S₂`
1131-
- `T₁` isTaskType»<S₁>`([§15.15.1](classes.md#15151-general)), `T₂` isTaskType»<S₂>`, and `T₁` is more specialized than `T₂`
1130+
- `T₁` isTaskType»<S₁>`([§15.14.1](classes.md#15141-general)), `T₂` isTaskType»<S₂>`, and `S₁` is a better conversion target than `S₂`
1131+
- `T₁` isTaskType»<S₁>`([§15.14.1](classes.md#15141-general)), `T₂` isTaskType»<S₂>`, and `T₁` is more specialized than `T₂`
11321132
- `T₁` is `S₁` or `S₁?` where `S₁` is a signed integral type, and `T₂` is `S₂` or `S₂?` where `S₂` is an unsigned integral type. Specifically:
11331133
- `S₁` is `sbyte` and `S₂` is `byte`, `ushort`, `uint`, or `ulong`
11341134
- `S₁` is `short` and `S₂` is `ushort`, `uint`, or `ulong`
@@ -2347,7 +2347,7 @@ A *this_access* is permitted only in the *block* of an instance constructor, an
23472347
- If the constructor declaration has no constructor initializer, the `this` variable behaves exactly the same as an output parameter of the struct type. In particular, this means that the variable shall be definitely assigned in every execution path of the instance constructor.
23482348
- Otherwise, the `this` variable behaves exactly the same as a `ref` parameter of the struct type. In particular, this means that the variable is considered initially assigned.
23492349
- When `this` is used in a *primary_expression* within an instance method or instance accessor of a struct, it is classified as a variable. The type of the variable is the instance type ([§15.3.2](classes.md#1532-the-instance-type)) of the struct within which the usage occurs.
2350-
- If the method or accessor is not an iterator ([§15.14](classes.md#1514-iterators)) or async function ([§15.15](classes.md#1515-async-functions)), the `this` variable represents the struct for which the method or accessor was invoked.
2350+
- If the method or accessor is not an iterator ([§15.15](classes.md#1515-synchronous-and-asynchronous-iterators)) or async function ([§15.14](classes.md#1514-async-functions)), the `this` variable represents the struct for which the method or accessor was invoked.
23512351
- If the struct is a `readonly struct`, the `this` variable behaves exactly the same as an input parameter of the struct type
23522352
- Otherwise the `this` variable behaves exactly the same as a `ref` parameter of the struct type
23532353
- If the method or accessor is an iterator or async function, the `this` variable represents a *copy* of the struct for which the method or accessor was invoked, and behaves exactly the same as a *value* parameter of the struct type.
@@ -3655,7 +3655,7 @@ await_expression
36553655
;
36563656
```
36573657

3658-
An *await_expression* is only allowed in the body of an async function ([§15.15](classes.md#1515-async-functions)). Within the nearest enclosing async function, an *await_expression* shall not occur in these places:
3658+
An *await_expression* is only allowed in the body of an async function ([§15.14](classes.md#1514-async-functions)). Within the nearest enclosing async function, an *await_expression* shall not occur in these places:
36593659

36603660
- Inside a nested (non-async) anonymous function
36613661
- Inside the block of a *lock_statement*
@@ -3696,7 +3696,7 @@ At run-time, the expression `await t` is evaluated as follows:
36963696

36973697
- An awaiter `a` is obtained by evaluating the expression `(t).GetAwaiter()`.
36983698
- A `bool` `b` is obtained by evaluating the expression `(a).IsCompleted`.
3699-
- If `b` is `false` then evaluation depends on whether `a` implements the interface `System.Runtime.CompilerServices.ICriticalNotifyCompletion` (hereafter known as `ICriticalNotifyCompletion` for brevity). This check is done at binding time; i.e., at run-time if `a` has the compile-time type `dynamic`, and at compile-time otherwise. Let `r` denote the resumption delegate ([§15.15](classes.md#1515-async-functions)):
3699+
- If `b` is `false` then evaluation depends on whether `a` implements the interface `System.Runtime.CompilerServices.ICriticalNotifyCompletion` (hereafter known as `ICriticalNotifyCompletion` for brevity). This check is done at binding time; i.e., at run-time if `a` has the compile-time type `dynamic`, and at compile-time otherwise. Let `r` denote the resumption delegate ([§15.14](classes.md#1514-async-functions)):
37003700
- If `a` does not implement `ICriticalNotifyCompletion`, then the expression
37013701
`((a) as INotifyCompletion).OnCompleted(r)` is evaluated.
37023702
- If `a` does implement `ICriticalNotifyCompletion`, then the expression
@@ -5094,7 +5094,7 @@ When recognising an *anonymous_function_body* if both the *null_conditional_invo
50945094
50955095
The `=>operator has the same precedence as assignment (`=`) and is right-associative.
50965096
5097-
An anonymous function with the `async` modifier is an async function and follows the rules described in [§15.15](classes.md#1515-async-functions).
5097+
An anonymous function with the `async` modifier is an async function and follows the rules described in [§15.14](classes.md#1514-async-functions).
50985098
50995099
The parameters of an anonymous function in the form of a *lambda_expression* can be explicitly or implicitly typed. In an explicitly typed parameter list, the type of each parameter is explicitly stated. In an implicitly typed parameter list, the types of the parameters are inferred from the context in which the anonymous function occursspecifically, when the anonymous function is converted to a compatible delegate type or expression tree type, that type provides the parameter types ([§10.7](conversions.md#107-anonymous-function-conversions)).
51005100

standard/grammar.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,10 +1741,10 @@ statement_expression_list
17411741
: statement_expression (',' statement_expression)*
17421742
;
17431743
1744-
// Source: §13.9.5 The foreach statement
1744+
// Source: §13.9.5.1 General
17451745
foreach_statement
1746-
: 'foreach' '(' ref_kind? local_variable_type identifier 'in'
1747-
expression ')' embedded_statement
1746+
: 'await'? 'foreach' '(' ref_kind? local_variable_type identifier
1747+
'in' expression ')' embedded_statement
17481748
;
17491749
17501750
// Source: §13.10.1 General

standard/portability-issues.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ A conforming implementation is required to document its choice of behavior in ea
6161
1. The layout of arrays, except in an unsafe context ([§12.8.17.4](expressions.md#128174-array-creation-expressions)).
6262
1. Whether there is any way to execute the *block* of an anonymous function other than through evaluation and invocation of the *lambda_expression* or *anonymous_method-expression* ([§12.19.3](expressions.md#12193-anonymous-function-bodies)).
6363
1. The exact timing of static field initialization ([§15.5.6.2](classes.md#15562-static-field-initialization)).
64-
1. The result of invoking `MoveNext` when an enumerator object is running ([§15.14.5.2](classes.md#151452-the-movenext-method)).
65-
1. The result of accessing `Current` when an enumerator object is in the before, running, or after states ([§15.14.5.3](classes.md#151453-the-current-property)).
66-
1. The result of invoking `Dispose` when an enumerator object is in the running state ([§15.14.5.4](classes.md#151454-the-dispose-method)).
64+
1. The result of invoking `MoveNext` when an enumerator object is running ([§15.15.5.2](classes.md#151552-advance-the-enumerator)).
65+
1. The result of accessing `Current` when an enumerator object is in the before, running, or after states ([§15.15.5.3](classes.md#151553-retrieve-the-current-value)).
66+
1. The result of invoking `Dispose` when an enumerator object is in the running state ([§15.15.5.4](classes.md#151554-dispose-of-resources)).
6767
1. The attributes of a type declared in multiple parts are determined by combining, in an unspecified order, the attributes of each of its parts ([§22.3](attributes.md#223-attribute-specification)).
6868
1. The order in which members are packed into a struct ([§23.6.9](unsafe-code.md#2369-the-sizeof-operator)).
6969
1. An exception occurs during finalizer execution, and that exception is not caught ([§21.4](exceptions.md#214-how-exceptions-are-handled)).

0 commit comments

Comments
 (0)