Skip to content

Commit afbf099

Browse files
authored
Refactor the subsections of §12.8.17, "The new operator" (#1247)
* Rearrange New Expr Sections * Rearrange New Expr Sections * Rearrange New Expr Sections * Rearrange New Expr Sections * Rearrange New Expr Sections * Rearrange New Expr Sections * Rearrange New Expr Sections * Rearrange New Expr Sections * Rearrange New Expr Sections
1 parent 7a58947 commit afbf099

9 files changed

+121
-118
lines changed

standard/README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,12 @@
346346
- [§12.8.17](expressions.md#12817-the-new-operator) The new operator
347347
- [§12.8.17.1](expressions.md#128171-general) General
348348
- [§12.8.17.2](expressions.md#128172-object-creation-expressions) Object creation expressions
349-
- [§12.8.17.3](expressions.md#128173-object-initializers) Object initializers
350-
- [§12.8.17.4](expressions.md#128174-collection-initializers) Collection initializers
351-
- [§12.8.17.5](expressions.md#128175-array-creation-expressions) Array creation expressions
352-
- [§12.8.17.6](expressions.md#128176-delegate-creation-expressions) Delegate creation expressions
353-
- [§12.8.17.7](expressions.md#128177-anonymous-object-creation-expressions) Anonymous object creation expressions
349+
- [§12.8.17.2.1](§NewGeneral) General
350+
- [§12.8.17.2.2](expressions.md#1281722-object-initializers) Object initializers
351+
- [§12.8.17.2.3](expressions.md#1281723-collection-initializers) Collection initializers
352+
- [§12.8.17.2.4](expressions.md#1281724-anonymous-object-creation-expressions) Anonymous object creation expressions
353+
- [§12.8.17.3](expressions.md#128173-array-creation-expressions) Array creation expressions
354+
- [§12.8.17.4](expressions.md#128174-delegate-creation-expressions) Delegate creation expressions
354355
- [§12.8.18](expressions.md#12818-the-typeof-operator) The typeof operator
355356
- [§12.8.19](expressions.md#12819-the-sizeof-operator) The sizeof operator
356357
- [§12.8.20](expressions.md#12820-the-checked-and-unchecked-operators) The checked and unchecked operators

standard/arrays.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ When an array type `S[]` implements `IList<T>`, some of the members of the imple
102102
103103
## 17.3 Array creation
104104
105-
Array instances are created by *array_creation_expression*s ([§12.8.17.5](expressions.md#128175-array-creation-expressions)) or by field or local variable declarations that include an *array_initializer* ([§17.7](arrays.md#177-array-initializers)). Array instances can also be created implicitly as part of evaluating an argument list involving a parameter array ([§15.6.2.4](classes.md#15624-parameter-arrays)).
105+
Array instances are created by *array_creation_expression*s ([§12.8.17.3](expressions.md#128173-array-creation-expressions)) or by field or local variable declarations that include an *array_initializer* ([§17.7](arrays.md#177-array-initializers)). Array instances can also be created implicitly as part of evaluating an argument list involving a parameter array ([§15.6.2.4](classes.md#15624-parameter-arrays)).
106106
107107
When an array instance is created, the rank and length of each dimension are established and then remain constant for the entire lifetime of the instance. In other words, it is not possible to change the rank of an existing array instance, nor is it possible to resize its dimensions.
108108
@@ -158,7 +158,7 @@ Array covariance specifically does not extend to arrays of *value_type*s. For ex
158158
159159
## 17.7 Array initializers
160160
161-
Array initializers may be specified in field declarations ([§15.5](classes.md#155-fields)), local variable declarations ([§13.6.2](statements.md#1362-local-variable-declarations)), and array creation expressions ([§12.8.17.5](expressions.md#128175-array-creation-expressions)):
161+
Array initializers may be specified in field declarations ([§15.5](classes.md#155-fields)), local variable declarations ([§13.6.2](statements.md#1362-local-variable-declarations)), and array creation expressions ([§12.8.17.3](expressions.md#128173-array-creation-expressions)):
162162
163163
```ANTLR
164164
array_initializer

standard/classes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3015,7 +3015,7 @@ If an implementing declaration exists for a given partial method, the invocation
30153015
30163016
If a defining declaration but not an implementing declaration is given for a partial method `M`, the following restrictions apply:
30173017
3018-
- It is a compile-time error to create a delegate from `M` ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)).
3018+
- It is a compile-time error to create a delegate from `M` ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)).
30193019
30203020
- It is a compile-time error to refer to `M` inside an anonymous function that is converted to an expression tree type ([§8.6](types.md#86-expression-tree-types)).
30213021

standard/conversions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ Anonymous functions may influence overload resolution, and participate in type i
849849
850850
### 10.7.2 Evaluation of anonymous function conversions to delegate types
851851
852-
Conversion of an anonymous function to a delegate type produces a delegate instance that references the anonymous function and the (possibly empty) set of captured outer variables that are active at the time of the evaluation. When the delegate is invoked, the body of the anonymous function is executed. The code in the body is executed using the set of captured outer variables referenced by the delegate. A *delegate_creation_expression* ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)) can be used as an alternate syntax for converting an anonymous method to a delegate type.
852+
Conversion of an anonymous function to a delegate type produces a delegate instance that references the anonymous function and the (possibly empty) set of captured outer variables that are active at the time of the evaluation. When the delegate is invoked, the body of the anonymous function is executed. The code in the body is executed using the set of captured outer variables referenced by the delegate. A *delegate_creation_expression* ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)) can be used as an alternate syntax for converting an anonymous method to a delegate type.
853853
854854
The invocation list of a delegate produced from an anonymous function contains a single entry. The exact target object and target method of the delegate are unspecified. In particular, it is unspecified whether the target object of the delegate is `null`, the `this` value of the enclosing function member, or some other object.
855855

standard/delegates.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ This definition of compatibility allows covariance in return type and contravari
178178
179179
## 20.5 Delegate instantiation
180180
181-
An instance of a delegate is created by a *delegate_creation_expression* ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)), a conversion to a delegate type, delegate combination or delegate removal. The newly created delegate instance then refers to one or more of:
181+
An instance of a delegate is created by a *delegate_creation_expression* ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)), a conversion to a delegate type, delegate combination or delegate removal. The newly created delegate instance then refers to one or more of:
182182
183183
- The static method referenced in the *delegate_creation_expression*, or
184184
- The target object (which cannot be `null`) and instance method referenced in the *delegate_creation_expression*, or
185-
- Another delegate ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)).
185+
- Another delegate ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)).
186186
187187
> *Example*:
188188
>
@@ -212,7 +212,7 @@ An instance of a delegate is created by a *delegate_creation_expression* ([§12.
212212
213213
The set of methods encapsulated by a delegate instance is called an *invocation list*. When a delegate instance is created from a single method, it encapsulates that method, and its invocation list contains only one entry. However, when two non-`null` delegate instances are combined, their invocation lists are concatenatedin the order left operand then right operandto form a new invocation list, which contains two or more entries.
214214
215-
When a new delegate is created from a single delegate the resultant invocation list has just one entry, which is the source delegate ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)).
215+
When a new delegate is created from a single delegate the resultant invocation list has just one entry, which is the source delegate ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)).
216216
217217
Delegates are combined using the binary `+` ([§12.10.5](expressions.md#12105-addition-operator)) and `+=` operators ([§12.21.4](expressions.md#12214-compound-assignment)). A delegate can be removed from a combination of delegates, using the binary `-` ([§12.10.6](expressions.md#12106-subtraction-operator)) and `-=` operators ([§12.21.4](expressions.md#12214-compound-assignment)). Delegates can be compared for equality ([§12.12.9](expressions.md#12129-delegate-equality-operators)).
218218

0 commit comments

Comments
 (0)