Skip to content

Commit 3b3e35a

Browse files
[create-pull-request] automated change (#1340)
Co-authored-by: jskeet <[email protected]>
1 parent 064ce22 commit 3b3e35a

File tree

6 files changed

+41
-33
lines changed

6 files changed

+41
-33
lines changed

standard/README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -644,16 +644,19 @@
644644
- [§16.4.8](structs.md#1648-field-initializers) Field initializers
645645
- [§16.4.9](structs.md#1649-constructors) Constructors
646646
- [§16.4.10](structs.md#16410-static-constructors) Static constructors
647-
- [§16.4.11](structs.md#16411-automatically-implemented-properties) Automatically implemented properties
648-
- [§16.4.12](structs.md#16412-safe-context-constraint) Safe context constraint
649-
- [§16.4.12.1](structs.md#164121-general) General
650-
- [§16.4.12.2](structs.md#164122-parameter-safe-context) Parameter safe context
651-
- [§16.4.12.3](structs.md#164123-local-variable-safe-context) Local variable safe context
652-
- [§16.4.12.4](structs.md#164124-field-safe-context) Field safe context
653-
- [§16.4.12.5](structs.md#164125-operators) Operators
654-
- [§16.4.12.6](structs.md#164126-method-and-property-invocation) Method and property invocation
655-
- [§16.4.12.7](structs.md#164127-stackalloc) stackalloc
656-
- [§16.4.12.8](structs.md#164128-constructor-invocations) Constructor invocations
647+
- [§16.4.11](structs.md#16411-properties) Properties
648+
- [§16.4.12](structs.md#16412-methods) Methods
649+
- [§16.4.13](structs.md#16413-indexers) Indexers
650+
- [§16.4.14](structs.md#16414-events) Events
651+
- [§16.4.15](structs.md#16415-safe-context-constraint) Safe context constraint
652+
- [§16.4.15.1](structs.md#164151-general) General
653+
- [§16.4.15.2](structs.md#164152-parameter-safe-context) Parameter safe context
654+
- [§16.4.15.3](structs.md#164153-local-variable-safe-context) Local variable safe context
655+
- [§16.4.15.4](structs.md#164154-field-safe-context) Field safe context
656+
- [§16.4.15.5](structs.md#164155-operators) Operators
657+
- [§16.4.15.6](structs.md#164156-method-and-property-invocation) Method and property invocation
658+
- [§16.4.15.7](structs.md#164157-stackalloc) stackalloc
659+
- [§16.4.15.8](structs.md#164158-constructor-invocations) Constructor invocations
657660
- [§17](arrays.md#17-arrays) Arrays
658661
- [§17.1](arrays.md#171-general) General
659662
- [§17.2](arrays.md#172-array-types) Array types

standard/classes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,7 +2133,7 @@ Grammar notes:
21332133

21342134
> *Note*: The overlapping of, and priority between, alternatives here is solely for descriptive convenience; the grammar rules could be elaborated to remove the overlap. ANTLR, and other grammar systems, adopt the same convenience and so *method_body* has the specified semantics automatically. *end note*
21352135
2136-
A *method_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)) and one of the permitted kinds of declared accessibility ([§15.3.6](classes.md#1536-access-modifiers)), the `new` ([§15.3.5](classes.md#1535-the-new-modifier)), `static` ([§15.6.3](classes.md#1563-static-and-instance-methods)), `virtual` ([§15.6.4](classes.md#1564-virtual-methods)), `override` ([§15.6.5](classes.md#1565-override-methods)), `sealed` ([§15.6.6](classes.md#1566-sealed-methods)), `abstract` ([§15.6.7](classes.md#1567-abstract-methods)), `extern` ([§15.6.8](classes.md#1568-external-methods)) and `async` ([§15.15](classes.md#1515-async-functions)). Additionally a *method_declaration* that is contained directly by a *struct_declaration* may include the `readonly` modifier (§cands-diffs-methods).
2136+
A *method_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)) and one of the permitted kinds of declared accessibility ([§15.3.6](classes.md#1536-access-modifiers)), the `new` ([§15.3.5](classes.md#1535-the-new-modifier)), `static` ([§15.6.3](classes.md#1563-static-and-instance-methods)), `virtual` ([§15.6.4](classes.md#1564-virtual-methods)), `override` ([§15.6.5](classes.md#1565-override-methods)), `sealed` ([§15.6.6](classes.md#1566-sealed-methods)), `abstract` ([§15.6.7](classes.md#1567-abstract-methods)), `extern` ([§15.6.8](classes.md#1568-external-methods)) and `async` ([§15.15](classes.md#1515-async-functions)). Additionally a *method_declaration* that is contained directly by a *struct_declaration* may include the `readonly` modifier ([§16.4.12](structs.md#16412-methods)).
21372137

21382138
A declaration has a valid combination of modifiers if all of the following are true:
21392139

@@ -3303,7 +3303,7 @@ ref_property_body
33033303
33043304
*unsafe_modifier* ([§23.2](unsafe-code.md#232-unsafe-contexts)) is only available in unsafe code ([§23](unsafe-code.md#23-unsafe-code)).
33053305

3306-
A *property_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)) and any one of the permitted kinds of declared accessibility ([§15.3.6](classes.md#1536-access-modifiers)), the `new` ([§15.3.5](classes.md#1535-the-new-modifier)), `static` ([§15.7.2](classes.md#1572-static-and-instance-properties)), `virtual` ([§15.6.4](classes.md#1564-virtual-methods), [§15.7.6](classes.md#1576-virtual-sealed-override-and-abstract-accessors)), `override` ([§15.6.5](classes.md#1565-override-methods), [§15.7.6](classes.md#1576-virtual-sealed-override-and-abstract-accessors)), `sealed` ([§15.6.6](classes.md#1566-sealed-methods)), `abstract` ([§15.6.7](classes.md#1567-abstract-methods), [§15.7.6](classes.md#1576-virtual-sealed-override-and-abstract-accessors)) and `extern` ([§15.6.8](classes.md#1568-external-methods)). Additionally a *property_declaration* that is contained directly by a *struct_declaration* may include the `readonly` modifier (§16.4.11).
3306+
A *property_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)) and any one of the permitted kinds of declared accessibility ([§15.3.6](classes.md#1536-access-modifiers)), the `new` ([§15.3.5](classes.md#1535-the-new-modifier)), `static` ([§15.7.2](classes.md#1572-static-and-instance-properties)), `virtual` ([§15.6.4](classes.md#1564-virtual-methods), [§15.7.6](classes.md#1576-virtual-sealed-override-and-abstract-accessors)), `override` ([§15.6.5](classes.md#1565-override-methods), [§15.7.6](classes.md#1576-virtual-sealed-override-and-abstract-accessors)), `sealed` ([§15.6.6](classes.md#1566-sealed-methods)), `abstract` ([§15.6.7](classes.md#1567-abstract-methods), [§15.7.6](classes.md#1576-virtual-sealed-override-and-abstract-accessors)) and `extern` ([§15.6.8](classes.md#1568-external-methods)). Additionally a *property_declaration* that is contained directly by a *struct_declaration* may include the `readonly` modifier ([§16.4.11](structs.md#16411-properties)).
33073307

33083308
- The first declares a non-ref-valued property. Its value has type *type*. This kind of property may be readable and/or writeable.
33093309
- The second declares a ref-valued property. Its value is a *variable_reference* ([§9.5](variables.md#95-variable-references)), that may be `readonly`, to a variable of type *type*. This kind of property is only readable.
@@ -3395,7 +3395,7 @@ For a ref-valued property the *ref_get_accessor_declaration* consists optional a
33953395
The use of *accessor_modifier*s is governed by the following restrictions:
33963396

33973397
- An *accessor_modifier* shall not be used in an interface or in an explicit interface member implementation.
3398-
- The *accessor_modifier* `readonly` is permitted only in a *property_declaration* or *indexer_declaration* that is contained directly by a *struct_declaration* (§16.4.11, §cands-diffs-indexers).
3398+
- The *accessor_modifier* `readonly` is permitted only in a *property_declaration* or *indexer_declaration* that is contained directly by a *struct_declaration* ([§16.4.11](structs.md#16411-properties), [§16.4.13](structs.md#16413-indexers)).
33993399
- For a property or indexer that has no `override` modifier, an *accessor_modifier* is permitted only if the property or indexer has both a get and set accessor, and then is permitted only on one of those accessors.
34003400
- For a property or indexer that includes an `override` modifier, an accessor shall match the *accessor_modifier*, if any, of the accessor being overridden.
34013401
- The *accessor_modifier* shall declare an accessibility that is strictly more restrictive than the declared accessibility of the property or indexer itself. To be precise:
@@ -4048,7 +4048,7 @@ remove_accessor_declaration
40484048
40494049
*unsafe_modifier* ([§23.2](unsafe-code.md#232-unsafe-contexts)) is only available in unsafe code ([§23](unsafe-code.md#23-unsafe-code)).
40504050

4051-
An *event_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)) and any one of the permitted kinds of declared accessibility ([§15.3.6](classes.md#1536-access-modifiers)), the `new` ([§15.3.5](classes.md#1535-the-new-modifier)), `static` ([§15.6.3](classes.md#1563-static-and-instance-methods), [§15.8.4](classes.md#1584-static-and-instance-events)), `virtual` ([§15.6.4](classes.md#1564-virtual-methods), [§15.8.5](classes.md#1585-virtual-sealed-override-and-abstract-accessors)), `override` ([§15.6.5](classes.md#1565-override-methods), [§15.8.5](classes.md#1585-virtual-sealed-override-and-abstract-accessors)), `sealed` ([§15.6.6](classes.md#1566-sealed-methods)), `abstract` ([§15.6.7](classes.md#1567-abstract-methods), [§15.8.5](classes.md#1585-virtual-sealed-override-and-abstract-accessors)) and `extern` ([§15.6.8](classes.md#1568-external-methods)) modifiers. Additionally an *event_declaration* that is contained directly by a *struct_declaration* may include the `readonly` modifier (§cands-diffs-methods).
4051+
An *event_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)) and any one of the permitted kinds of declared accessibility ([§15.3.6](classes.md#1536-access-modifiers)), the `new` ([§15.3.5](classes.md#1535-the-new-modifier)), `static` ([§15.6.3](classes.md#1563-static-and-instance-methods), [§15.8.4](classes.md#1584-static-and-instance-events)), `virtual` ([§15.6.4](classes.md#1564-virtual-methods), [§15.8.5](classes.md#1585-virtual-sealed-override-and-abstract-accessors)), `override` ([§15.6.5](classes.md#1565-override-methods), [§15.8.5](classes.md#1585-virtual-sealed-override-and-abstract-accessors)), `sealed` ([§15.6.6](classes.md#1566-sealed-methods)), `abstract` ([§15.6.7](classes.md#1567-abstract-methods), [§15.8.5](classes.md#1585-virtual-sealed-override-and-abstract-accessors)) and `extern` ([§15.6.8](classes.md#1568-external-methods)) modifiers. Additionally an *event_declaration* that is contained directly by a *struct_declaration* may include the `readonly` modifier ([§16.4.12](structs.md#16412-methods)).
40524052

40534053
Event declarations are subject to the same rules as method declarations ([§15.6](classes.md#156-methods)) with regard to valid combinations of modifiers.
40544054

@@ -4331,7 +4331,7 @@ ref_indexer_body
43314331
43324332
*unsafe_modifier* ([§23.2](unsafe-code.md#232-unsafe-contexts)) is only available in unsafe code ([§23](unsafe-code.md#23-unsafe-code)).
43334333

4334-
An *indexer_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)) and any one of the permitted kinds of declared accessibility ([§15.3.6](classes.md#1536-access-modifiers)), the `new` ([§15.3.5](classes.md#1535-the-new-modifier)), `virtual` ([§15.6.4](classes.md#1564-virtual-methods)), `override` ([§15.6.5](classes.md#1565-override-methods)), `sealed` ([§15.6.6](classes.md#1566-sealed-methods)), `abstract` ([§15.6.7](classes.md#1567-abstract-methods)) and `extern` ([§15.6.8](classes.md#1568-external-methods)) modifiers. Additionally an *indexer_declaration* that is contained directly by a *struct_declaration* may include the `readonly` modifier (§cands-diffs-methods).
4334+
An *indexer_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)) and any one of the permitted kinds of declared accessibility ([§15.3.6](classes.md#1536-access-modifiers)), the `new` ([§15.3.5](classes.md#1535-the-new-modifier)), `virtual` ([§15.6.4](classes.md#1564-virtual-methods)), `override` ([§15.6.5](classes.md#1565-override-methods)), `sealed` ([§15.6.6](classes.md#1566-sealed-methods)), `abstract` ([§15.6.7](classes.md#1567-abstract-methods)) and `extern` ([§15.6.8](classes.md#1568-external-methods)) modifiers. Additionally an *indexer_declaration* that is contained directly by a *struct_declaration* may include the `readonly` modifier ([§16.4.12](structs.md#16412-methods)).
43354335

43364336
- The first declares a non-ref-valued indexer. Its value has type *type*. This kind of indexer may be readable and/or writeable.
43374337
- The second declares a ref-valued indexer. Its value is a *variable_reference* ([§9.5](variables.md#95-variable-references)), that may be `readonly`, to a variable of type *type*. This kind of indexer is only readable.

standard/expressions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,7 @@ A *null_conditional_projection_initializer* is a restriction of *null_conditiona
18111811
#### 12.8.9.1 General
18121812

18131813
A null-forgiving expressions value, type, classification ([§12.2](expressions.md#122-expression-classifications))
1814-
and safe-context ([§16.4.12](structs.md#16412-safe-context-constraint)) is the value, type, classification and safe-context of its *primary_expression*.
1814+
and safe-context ([§16.4.15](structs.md#16415-safe-context-constraint)) is the value, type, classification and safe-context of its *primary_expression*.
18151815

18161816
```ANTLR
18171817
null_forgiving_expression
@@ -3288,7 +3288,7 @@ A *default_value_expression* is a constant expression ([§12.23](expressions.md#
32883288

32893289
A stack allocation expression allocates a block of memory from the execution stack. The ***execution stack*** is an area of memory where local variables are stored. The execution stack is not part of the managed heap. The memory used for local variable storage is automatically recovered when the current function returns.
32903290

3291-
The safe context rules for a stack allocation expression are described in [§16.4.12.7](structs.md#164127-stackalloc).
3291+
The safe context rules for a stack allocation expression are described in [§16.4.15.7](structs.md#164157-stackalloc).
32923292

32933293
```ANTLR
32943294
stackalloc_expression

standard/grammar.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,6 +2087,7 @@ ref_method_modifier
20872087
| 'override'
20882088
| 'abstract'
20892089
| 'extern'
2090+
| 'readonly' // direct struct members only
20902091
| unsafe_modifier // unsafe code support
20912092
;
20922093
@@ -2169,6 +2170,7 @@ property_modifier
21692170
| 'override'
21702171
| 'abstract'
21712172
| 'extern'
2173+
| 'readonly' // direct struct members only
21722174
| unsafe_modifier // unsafe code support
21732175
;
21742176
@@ -2208,6 +2210,7 @@ accessor_modifier
22082210
| 'internal' 'protected'
22092211
| 'protected' 'private'
22102212
| 'private' 'protected'
2213+
| 'readonly' // direct struct members only
22112214
;
22122215
22132216
accessor_body
@@ -2245,6 +2248,7 @@ event_modifier
22452248
| 'override'
22462249
| 'abstract'
22472250
| 'extern'
2251+
| 'readonly' // direct struct members only
22482252
| unsafe_modifier // unsafe code support
22492253
;
22502254
@@ -2278,6 +2282,7 @@ indexer_modifier
22782282
| 'override'
22792283
| 'abstract'
22802284
| 'extern'
2285+
| 'readonly' // direct struct members only
22812286
| unsafe_modifier // unsafe code support
22822287
;
22832288

0 commit comments

Comments
 (0)