Skip to content

Commit 4e64ae0

Browse files
[create-pull-request] automated change (#1224)
Co-authored-by: BillWagner <[email protected]>
1 parent f4debe3 commit 4e64ae0

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

standard/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@
140140
- [§9.2.7](variables.md#927-output-parameters) Output parameters
141141
- [§9.2.8](variables.md#928-input-parameters) Input parameters
142142
- [§9.2.9](variables.md#929-local-variables) Local variables
143-
- [§9.2.9.1](variables.md#9291-discards) Discards
143+
- [§9.2.9.1](variables.md#9291-general) General
144+
- [§9.2.9.2](variables.md#9292-discards) Discards
144145
- [§9.3](variables.md#93-default-values) Default values
145146
- [§9.4](variables.md#94-definite-assignment) Definite assignment
146147
- [§9.4.1](variables.md#941-general) General

standard/expressions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4892,7 +4892,7 @@ A declaration expression that is a simple discard or where the *local_variable_t
48924892

48934893
Otherwise, the declaration expression is classified as an *explicitly typed* variable, and the type of the expression as well as the declared variable shall be that given by the *local_variable_type*.
48944894

4895-
A declaration expression with the identifier `_` is a discard ([§9.2.9.1](variables.md#9291-discards)), and does not introduce a name for the variable. A declaration expression with an identifier other than `_` introduces that name into the nearest enclosing local variable declaration space ([§7.3](basic-concepts.md#73-declarations)).
4895+
A declaration expression with the identifier `_` is a discard ([§9.2.9.2](variables.md#9292-discards)), and does not introduce a name for the variable. A declaration expression with an identifier other than `_` introduces that name into the nearest enclosing local variable declaration space ([§7.3](basic-concepts.md#73-declarations)).
48964896

48974897
> *Example*:
48984898
>
@@ -5227,7 +5227,7 @@ Any local variable, value parameter, or parameter array whose scope includes the
52275227
52285228
#### 12.19.6.2 Captured outer variables
52295229
5230-
When an outer variable is referenced by an anonymous function, the outer variable is said to have been ***captured*** by the anonymous function. Ordinarily, the lifetime of a local variable is limited to execution of the block or statement with which it is associated (§local-var-general). However, the lifetime of a captured outer variable is extended at least until the delegate or expression tree created from the anonymous function becomes eligible for garbage collection.
5230+
When an outer variable is referenced by an anonymous function, the outer variable is said to have been ***captured*** by the anonymous function. Ordinarily, the lifetime of a local variable is limited to execution of the block or statement with which it is associated ([§9.2.9.1](variables.md#9291-general)). However, the lifetime of a captured outer variable is extended at least until the delegate or expression tree created from the anonymous function becomes eligible for garbage collection.
52315231
52325232
> *Example*: In the example
52335233
>

standard/lexical-structure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ Two identifiers are considered the same if they are identical after the followin
556556
The semantics of an identifier named `_` depends on the context in which it appears:
557557
558558
- It can denote a named program element, such as a variable, class, or method, or
559-
- It can denote a discard ([§9.2.9.1](variables.md#9291-discards)).
559+
- It can denote a discard ([§9.2.9.2](variables.md#9292-discards)).
560560
561561
Identifiers containing two consecutive underscore characters (`U+005F`) are reserved for use by the implementation; however, no diagnostic is required if such an identifier is defined.
562562

standard/patterns.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The runtime type of the value is tested against the *type* in the pattern using
6868

6969
> *Note*: The is-type expression `e is T` and the declaration pattern `e is T _` are equivalent when `T` isn’t a nullable type. *end note*
7070
71-
Given a pattern input value ([§11.1](patterns.md#111-general)) *e*, if the *simple_designation* is the *identifier* `_`, it denotes a discard ([§9.2.9.1](variables.md#9291-discards)) and the value of *e* is not bound to anything. (Although a declared variable with the name `_` may be in scope at that point, that named variable is not seen in this context.) If *simple_designation* is any other identifier, a local variable (§local-var-general) of the given type named by the given identifier is introduced. That local variable is assigned the value of the pattern input value when the pattern *matches* the value.
71+
Given a pattern input value ([§11.1](patterns.md#111-general)) *e*, if the *simple_designation* is the *identifier* `_`, it denotes a discard ([§9.2.9.2](variables.md#9292-discards)) and the value of *e* is not bound to anything. (Although a declared variable with the name `_` may be in scope at that point, that named variable is not seen in this context.) If *simple_designation* is any other identifier, a local variable ([§9.2.9.1](variables.md#9291-general)) of the given type named by the given identifier is introduced. That local variable is assigned the value of the pattern input value when the pattern *matches* the value.
7272

7373
Certain combinations of static type of the pattern input value and the given type are considered incompatible and result in a compile-time error. A value of static type `E` is said to be ***pattern compatible*** with the type `T` if there exists an identity conversion, an implicit or explicit reference conversion, a boxing conversion, or an unboxing conversion from `E` to `T`, or if either `E` or `T` is an open type ([§8.4.3](types.md#843-open-and-closed-types)). A declaration pattern naming a type `T` is *applicable to* every type `E` for which `E` is pattern compatible with `T`.
7474

@@ -160,7 +160,7 @@ designation
160160
;
161161
```
162162
163-
Given a pattern input value ([§11.1](patterns.md#111-general)) *e*, if *designation* is the *identifier* `_`, it denotes a discard ([§9.2.9.1](variables.md#9291-discards)), and the value of *e* is not bound to anything. (Although a declared variable with that name may be in scope at that point, that named variable is not seen in this context.) If *designation* is any other identifier, at runtime the value of *e* is bound to a newly introduced local variable (§local-var-general) of that name whose type is the static type of *e*, and the pattern input value is assigned to that local variable.
163+
Given a pattern input value ([§11.1](patterns.md#111-general)) *e*, if *designation* is the *identifier* `_`, it denotes a discard ([§9.2.9.2](variables.md#9292-discards)), and the value of *e* is not bound to anything. (Although a declared variable with that name may be in scope at that point, that named variable is not seen in this context.) If *designation* is any other identifier, at runtime the value of *e* is bound to a newly introduced local variable ([§9.2.9.1](variables.md#9291-general)) of that name whose type is the static type of *e*, and the pattern input value is assigned to that local variable.
164164

165165
It is an error if the name `var` would bind to a type where a *var_pattern* is used.
166166

standard/variables.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Input parameters are discussed further in [§15.6.2.3.2](classes.md#156232-input
118118
119119
### 9.2.9 Local variables
120120
121-
#### §local-var-general General
121+
#### 9.2.9.1 General
122122
123123
A ***local variable*** is declared by a *local_variable_declaration*, *declaration_expression*, *foreach_statement*, or *specific_catch_clause* of a *try_statement*. A local variable can also be declared by certain kinds of *pattern*s ([§11](patterns.md#11-patterns-and-pattern-matching)). For a *foreach_statement*, the local variable is an iteration variable ([§13.9.5](statements.md#1395-the-foreach-statement)). For a *specific_catch_clause*, the local variable is an exception variable ([§13.11](statements.md#1311-the-try-statement)). A local variable declared by a *foreach_statement* or *specific_catch_clause* is considered initially assigned.
124124
@@ -157,7 +157,7 @@ A local variable introduced by a *local_variable_declaration* or *declaration_ex
157157
>
158158
> *end note*
159159
160-
#### 9.2.9.1 Discards
160+
#### 9.2.9.2 Discards
161161
162162
A ***discard*** is a local variable that has no name. A discard is introduced by a declaration expression ([§12.17](expressions.md#1217-declaration-expressions)) with the identifier `_`; and is either implicitly typed (`_` or `var _`) or explicitly typed (`T _`).
163163
@@ -1075,7 +1075,7 @@ For any variable, the ***ref-safe-context*** of that variable is the context whe
10751075
10761076
There are three ref-safe-contexts:
10771077
1078-
- ***declaration-block***: The ref-safe-context of a *variable_reference* to a local variable (§local-var-general) is that local variables scope ([§13.6.2](statements.md#1362-local-variable-declarations)), including any nested *embedded-statement*s in that scope.
1078+
- ***declaration-block***: The ref-safe-context of a *variable_reference* to a local variable (9.2.9.1](variables.md#9291-general)) is that local variables scope ([§13.6.2](statements.md#1362-local-variable-declarations)), including any nested *embedded-statement*s in that scope.
10791079
10801080
A *variable_reference* to a local variable is a valid referent for a reference variable only if the reference variable is declared within the ref-safe-context of that variable.
10811081

0 commit comments

Comments
 (0)