You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: standard/classes.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2193,7 +2193,7 @@ A declaration has a valid combination of modifiers if all of the following are t
2193
2193
- If the declaration includes the `private` modifier, then the declaration does not include any of the following modifiers: `virtual`, `override`, or `abstract`.
2194
2194
- If the declaration includes the `sealed` modifier, then the declaration also includes the `override` modifier.
2195
2195
- If the declaration includes the `partial` modifier, then it does not include the modifier `abstract`.
2196
-
- If the declaration is for an optional partial method (§optional-partial-methods), then it does not include any of the following modifiers: `new`, `public`, `protected`, `internal`, `private`, `virtual`, `sealed`, `override`, or `extern`.
2196
+
- If the declaration is for an optional partial method ([§15.6.9.2](classes.md#15692-optional-partial-methods)), then it does not include any of the following modifiers: `new`, `public`, `protected`, `internal`, `private`, `virtual`, `sealed`, `override`, or `extern`.
2197
2197
2198
2198
Methods are classified according to what, if anything, they return:
2199
2199
@@ -2434,7 +2434,7 @@ For a `struct` type, within an instance method, instance accessor ([§12.2.1](ex
2434
2434
2435
2435
A parameter declared with an `out` modifier is an ***output parameter***. For definite-assignment rules, see [§9.2.7](variables.md#927-output-parameters).
2436
2436
2437
-
A method declared as an optional partial method (§optional-partial-methods) shall not have output parameters.
2437
+
A method declared as an optional partial method ([§15.6.9.2](classes.md#15692-optional-partial-methods)) shall not have output parameters.
- Thedeclarationsshallhavethesamemodifiersexceptforthe `async` and `extern` modifiers. The `async` and `extern` modifiersareallowedonlyontheimplementingpartialmethoddeclaration.
Therearetwovariationsofpartialmethods: requiredandoptional. A ***requiredpartialmethod*** (§required-partial-methods) isapartialmethodthatincludesoneormoreexplicitaccessmodifiers. An ***optionalpartialmethod*** (§optional-partial-methods) hasnoexplicitaccessmodifiers, andisimplicitlyprivate.
3119
+
Therearetwovariationsofpartialmethods: requiredandoptional. A ***requiredpartialmethod*** ([§15.6.9.3](classes.md#15693-required-partial-methods))isapartialmethodthatincludesoneormoreexplicitaccessmodifiers. An ***optionalpartialmethod*** ([§15.6.9.2](classes.md#15692-optional-partial-methods)) hasnoexplicitaccessmodifiers, andisimplicitlyprivate.
@@ -3173,7 +3173,7 @@ If an implementing declaration exists for a given partial method, the invocation
3173
3173
- The `partial` modifier is not included in the combined method declaration.
3174
3174
- The attributes in the resulting method declaration are the combined attributes of the defining and the implementing partial method declaration in unspecified order. Duplicates are not removed.
3175
3175
- The attributes on the parameters of the resulting method declaration are the combined attributes of the corresponding parameters of the defining and the implementing partial method declaration in unspecified order. Duplicates are not removed.
3176
-
- Any default arguments (§15.6.2) intheimplementingdeclarationareremoved.
3176
+
- Any default arguments ([§15.6.2](classes.md#1562-method-parameters)) intheimplementingdeclarationareremoved.
3177
3177
3178
3178
Partialmethodsareusefulfor allowing one part of a type declaration to customize the behavior of another part, e.g., one that is generated by a tool. Consider the following partial class declaration:
An optional partial method shall have a `void` return type, and shall not declare out parameters. There shall be zero or one implementing declaration for each defining declaration. If no part implements the partial method, the partial method declaration and all calls to it are removed from the type declaration resulting from the combination of the parts. Whether or not an implementing declaration is given, invocation expressions may resolve to invocations of the partial method.
3263
3263
3264
-
The implementing member for an optional partial method shall not be an external method (§15.6.8).
3264
+
The implementing member for an optional partial method shall not be an external method ([§15.6.8](classes.md#1568-external-methods)).
3265
3265
3266
3266
> *Note*: Because an optional partial method always returns `void`, such invocation expressions will always be expression statements. Furthermore, because an optional partial method is implicitly `private`, such statements will always occur within one of the parts of the type declaration within which the partial method is declared. *end note*
3267
3267
@@ -3274,11 +3274,11 @@ If a defining declaration but not an implementing declaration is given for an op
3274
3274
- Expressions occurring as part of an invocation of `M` do not affect the definite assignment state ([§9.4](variables.md#94-definite-assignment)), which can potentially lead to compile-time errors.
3275
3275
-`M` cannot be the entry point for an application ([§7.1](basic-concepts.md#71-application-startup)).
A required partial method declaration includes an explicit access modifier. There shall be exactly one implementing partial method declaration.
3280
3280
3281
-
The implementing declaration for a required partial method may be an external method (§15.6.8). The `extern` modifier is allowed on an implementing partial declaration. It shall not be present on a defining partial declaration.
3281
+
The implementing declaration for a required partial method may be an external method ([§15.6.8](classes.md#1568-external-methods)). The `extern` modifier is allowed on an implementing partial declaration. It shall not be present on a defining partial declaration.
3282
3282
3283
3283
> *Note:* The `private` access modifier is required on both the ***defining partial method declaration*** and the ***implementing partial method declaration*** of a private required partial method. *end note*
Copy file name to clipboardExpand all lines: standard/expressions.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1595,7 +1595,7 @@ simple_name
1595
1595
1596
1596
A *simple_name* is either of the form `I` or of the form `I<A₁, ..., Aₑ>`, where `I` is a single identifier and `I<A₁, ..., Aₑ>` is an optional *type_argument_list*. When no *type_argument_list* is specified, consider `e` to be zero. The *simple_name* is evaluated and classified as follows:
1597
1597
1598
-
- If `e` is zero and the *simple_name* appears within a local variable declaration space ([§7.3](basic-concepts.md#73-declarations)) that directly contains a local variable, parameter (with the exception of discard parameters (§12.22.2)), or constant with name `I`, then the *simple_name* refers to that local variable, parameter or constant and is classified as a variable or value.
1598
+
- If `e` is zero and the *simple_name* appears within a local variable declaration space ([§7.3](basic-concepts.md#73-declarations)) that directly contains a local variable, parameter (with the exception of discard parameters ([§12.22.2](expressions.md#12222-anonymous-function-signatures))), or constant with name `I`, then the *simple_name* refers to that local variable, parameter or constant and is classified as a variable or value.
1599
1599
- If `e` is zero and the *simple_name* appears within a generic method declaration but outside the *attributes* of its *method_declaration*, and if that declaration includes a type parameter with name `I`, then the *simple_name* refers to that type parameter.
1600
1600
- Otherwise, for each instance type `T` ([§15.3.2](classes.md#1532-the-instance-type)), starting with the instance type of the immediately enclosing type declaration and continuing with the instance type of each enclosing class or struct declaration (if any):
1601
1601
- If `e` is zero and the declaration of `T` includes a type parameter with name `I`, then the *simple_name* refers to that type parameter.
@@ -5464,9 +5464,9 @@ If the modifier `static` is present, the anonymous function cannot capture state
5464
5464
A non-`static` local function or non-`static` anonymous function can capture state from an enclosing `static` anonymous function, but cannot capture state outside the enclosing `static` anonymous function.
5465
5465
5466
5466
<!-- markdownlint-disable MD028 -->
5467
-
> *Note*: Removing the `static` modifier from an anonymous function in a valid program does not change the meaning of the program, other than possibly affecting delegate instance identity (§10.7.2). *end note*
5467
+
> *Note*: Removing the `static` modifier from an anonymous function in a valid program does not change the meaning of the program, other than possibly affecting delegate instance identity ([§10.7.2](conversions.md#1072-evaluation-of-anonymous-function-conversions-to-delegate-types)). *end note*
5468
5468
5469
-
> *Note*: A `static` anonymous function is not required to produce the same delegate instance on each evaluation. See §10.7.2. *end note*
5469
+
> *Note*: A `static` anonymous function is not required to produce the same delegate instance on each evaluation. See [§10.7.2](conversions.md#1072-evaluation-of-anonymous-function-conversions-to-delegate-types). *end note*
5470
5470
<!-- markdownlint-enable MD028 -->
5471
5471
5472
5472
When recognising an *anonymous_function_body* if both the *null_conditional_invocation_expression* and *expression* alternatives are applicable then the former shall be chosen.
Copy file name to clipboardExpand all lines: standard/patterns.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -430,7 +430,7 @@ type_pattern
430
430
;
431
431
```
432
432
433
-
A type pattern naming a type `T` is *applicable to* every type `E` for which `E` is *pattern compatible* with `T` (§11.2.2).
433
+
A type pattern naming a type `T` is *applicable to* every type `E` for which `E` is *pattern compatible* with `T` ([§11.2.2](patterns.md#1122-declaration-pattern)).
434
434
435
435
The runtime type of the value is tested against *type* using the same rules specified in the is-type operator ([§12.15.12.1](expressions.md#1215121-the-is-type-operator)). If the test succeeds, the pattern matches that value. It is a compile-time error if the *type* is a nullable type. This pattern form never matches a `null` value.
436
436
@@ -522,7 +522,7 @@ In a *conjunctive_pattern*, the *input type* of the second pattern is narrowed b
522
522
- If `P` is a type pattern, the *narrowed type* is the type of the type pattern's type.
523
523
- Otherwise, if `P` is a declaration pattern, the *narrowed type* is the type of the declaration pattern's type.
524
524
- Otherwise, if `P` is a recursive pattern that gives an explicit type, the *narrowed type* is that type.
525
-
- Otherwise, if `P` is matched via the rules for `ITuple` in a *positional_pattern* (§11.2.5), the *narrowed type* is the type `System.ITuple`.
525
+
- Otherwise, if `P` is matched via the rules for `ITuple` in a *positional_pattern* ([§11.2.5](patterns.md#1125-positional-pattern)), the *narrowed type* is the type `System.ITuple`.
526
526
- Otherwise, if `P` is a constant pattern where the constant is not the null constant and where the expression has no *constant expression conversion* to the *input type*, the *narrowed type* is the type of the constant.
527
527
- Otherwise, if `P` is a relational pattern where the constant expression has no *constant expression conversion* to the *input type*, the *narrowed type* is the type of the constant.
528
528
- Otherwise, if `P` is an `or` pattern, the *narrowed type* is the common type of the *narrowed type* of the subpatterns if such a common type exists. For this purpose, the common type algorithm considers only identity, boxing, and implicit reference conversions, and it considers all subpatterns of a sequence of `or` patterns (ignoring parenthesized patterns).
Copy file name to clipboardExpand all lines: standard/types.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,7 +217,7 @@ nullable_value_type
217
217
;
218
218
```
219
219
220
-
Because the names `nint` and `nuint` are not keywords there is syntactic ambiguity between recognising them as a *type_name* or a *value_type*. If type resolution (§7.8.1) on either of these names succeeds, that name shall be recognised as a *type_name*; otherwise it shall be recognised as a *value_type*.
220
+
Because the names `nint` and `nuint` are not keywords there is syntactic ambiguity between recognising them as a *type_name* or a *value_type*. If type resolution ([§7.8.1](basic-concepts.md#781-general)) on either of these names succeeds, that name shall be recognised as a *type_name*; otherwise it shall be recognised as a *value_type*.
221
221
222
222
Unlike a variable of a reference type, a variable of a value type can contain the value `null` only if the value type is a nullable value type ([§8.3.12](types.md#8312-nullable-value-types)). For every non-nullable value type there is a corresponding nullable value type denoting the same set of values plus the value `null`.
0 commit comments