Skip to content

Commit a0995e5

Browse files
[create-pull-request] automated change (#1562)
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
1 parent 2760560 commit a0995e5

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

standard/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@
650650
- [§16.2.5](structs.md#1625-struct-interfaces) Struct interfaces
651651
- [§16.2.6](structs.md#1626-struct-body) Struct body
652652
- [§16.3](structs.md#163-struct-members) Struct members
653+
- [§16.3.1](structs.md#1631-general) General
654+
- [§16.3.2](structs.md#1632-readonly-members) Readonly members
653655
- [§16.4](structs.md#164-class-and-struct-differences) Class and struct differences
654656
- [§16.4.1](structs.md#1641-general) General
655657
- [§16.4.2](structs.md#1642-value-semantics) Value semantics

standard/conversions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ A user-defined explicit conversion from an expression `E` to a type `T` is pro
722722
- Otherwise, the conversion is ambiguous and a compile-time error occurs.
723723
- Finally, determine the runtime conversions required, in order:
724724
- If `E` does not already have the type `Sₓ`, then a standard explicit conversion from `E` to `Sₓ` is required.
725-
- If this added standard explicit conversion is an explicit numeric10.3.2) or enumeration10.3.3) one which may result in information loss (§10.3.2), and the context is `unchecked` (§12.8.20, §13.12), then a compile-time warning shall be issued.<br>*Note*: In a `checked` context information loss would result in a runtime exception, hence no warning is required. If information loss is intended adding an explicit cast to the source will document this and silence the warning. *end note*
725+
- If this added standard explicit conversion is an explicit numeric ([§10.3.2](conversions.md#1032-explicit-numeric-conversions)) or enumeration ([§10.3.3](conversions.md#1033-explicit-enumeration-conversions)) one which may result in information loss ([§10.3.2](conversions.md#1032-explicit-numeric-conversions)), and the context is `unchecked` ([§12.8.20](expressions.md#12820-the-checked-and-unchecked-operators), [§13.12](statements.md#1312-the-checked-and-unchecked-statements)), then a compile-time warning shall be issued.<br>*Note*: In a `checked` context information loss would result in a runtime exception, hence no warning is required. If information loss is intended adding an explicit cast to the source will document this and silence the warning. *end note*
726726
- The most-specific user-defined conversion operator is required to convert from `Sₓ` to `Tₓ`.
727727
- If `Tₓ` is not `T`, then a standard explicit conversion from `Tₓ` to `T` is required.
728728

standard/grammar.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,7 +2175,7 @@ ref_method_modifier
21752175
| 'override'
21762176
| 'abstract'
21772177
| 'extern'
2178-
| 'readonly' // direct struct members only
2178+
| 'readonly' // struct members only
21792179
| unsafe_modifier // unsafe code support
21802180
;
21812181
@@ -2259,7 +2259,7 @@ property_modifier
22592259
| 'override'
22602260
| 'abstract'
22612261
| 'extern'
2262-
| 'readonly' // direct struct members only
2262+
| 'readonly' // struct members only
22632263
| unsafe_modifier // unsafe code support
22642264
;
22652265
@@ -2299,7 +2299,7 @@ accessor_modifier
22992299
| 'internal' 'protected'
23002300
| 'protected' 'private'
23012301
| 'private' 'protected'
2302-
| 'readonly' // direct struct members only
2302+
| 'readonly' // struct members only
23032303
;
23042304
23052305
accessor_body
@@ -2337,7 +2337,7 @@ event_modifier
23372337
| 'override'
23382338
| 'abstract'
23392339
| 'extern'
2340-
| 'readonly' // direct struct members only
2340+
| 'readonly' // struct members only
23412341
| unsafe_modifier // unsafe code support
23422342
;
23432343
@@ -2371,7 +2371,7 @@ indexer_modifier
23712371
| 'override'
23722372
| 'abstract'
23732373
| 'extern'
2374-
| 'readonly' // direct struct members only
2374+
| 'readonly' // struct members only
23752375
| unsafe_modifier // unsafe code support
23762376
;
23772377
@@ -2535,7 +2535,7 @@ struct_body
25352535
: '{' struct_member_declaration* '}'
25362536
;
25372537
2538-
// Source: §16.3 Struct members
2538+
// Source: §16.3.1 General
25392539
struct_member_declaration
25402540
: constant_declaration
25412541
| field_declaration

standard/structs.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ struct_body
114114

115115
## 16.3 Struct members
116116

117-
### §struct_general General
117+
### 16.3.1 General
118118

119119
The members of a struct consist of the members introduced by its *struct_member_declaration*s and the members inherited from the type `System.ValueType`.
120120

@@ -140,20 +140,20 @@ struct_member_declaration
140140
141141
Except for the differences noted in [§16.4](structs.md#164-class-and-struct-differences), the descriptions of class members provided in [§15.3](classes.md#153-class-members) through [§15.12](classes.md#1512-static-constructors) apply to struct members as well.
142142

143-
### §struct_readonly Readonly members
143+
### 16.3.2 Readonly members
144144

145145
An instance member definition or accessor of an instance property, indexer, or event that includes the `readonly` modifier has the following restrictions:
146146

147147
- The `this` parameter is a `ref readonly` reference.
148148
- The member shall not reassign the value of `this` or an instance field of the receiver.
149-
- The member shall not reassign the value of an instance field-like event (§15.8.2) of the receiver.
149+
- The member shall not reassign the value of an instance field-like event ([§15.8.2](classes.md#1582-field-like-events)) of the receiver.
150150
- If a readonly member invokes a non-readonly member, the structure referred to by `this` must be copied to use a writable reference for the `this` argument.
151151

152-
> *Note:* Instance fields include the hidden backing field used for automatically implemented properties (§15.7.4). *end note*
152+
> *Note:* Instance fields include the hidden backing field used for automatically implemented properties ([§15.7.4](classes.md#1574-automatically-implemented-properties)). *end note*
153153
<!-- markdownlint-disable MD028 -->
154154
155155
<!-- markdownlint-enable MD028 -->
156-
> *Example*: A readonly member can modify the state of an object referred to by an instance field, even though the readonly member can't reassign that instance member. The following code demonstrates the reassigning and modifying an instance field:
156+
> *Example*: A readonly member can modify the state of an object referred to by an instance field, even though the readonly member cant reassign that instance member. The following code demonstrates the reassigning and modifying an instance field:
157157
>
158158
> <!-- Example: {template:"standalone-lib-without-using", name:"ReadonlyMember" } -->
159159
> ```csharp

0 commit comments

Comments
 (0)