Skip to content

Commit 5b5e16b

Browse files
BillWagnerjskeet
authored andcommitted
Add text for readonly member
Fixes #928 The PR for readonly members in structs did not add text that a temporary copy of `this` wasn't required to invoke a readonly member. (The clause in structs did state that a copy wasn't required, but that left the spec in an inconsistent state.
1 parent 49ae79b commit 5b5e16b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

standard/expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ The run-time processing of a function member invocation consists of the followin
12231223
- `M` is invoked.
12241224
- Otherwise, if the type of `E` is a value-type `V`, and `M` is declared or overridden in `V`:
12251225
- `E` is evaluated. If this evaluation causes an exception, then no further steps are executed. For an instance constructor, this evaluation consists of allocating storage (typically from an execution stack) for the new object. In this case `E` is classified as a variable.
1226-
- If `E` is not classified as a variable, or if `V` is not a readonly struct type ([§16.2.2](structs.md#1622-struct-modifiers)), and `E` is one of:
1226+
- If `E` is not classified as a variable, or if `V` is not a readonly struct type ([§16.2.2](structs.md#1622-struct-modifiers)) and the declaration of `M` does not include the `readonly` modifier16.4.12), and `E` is one of:
12271227
- an input parameter ([§15.6.2.3.2](classes.md#156232-input-parameters)), or
12281228
- a `readonly` field ([§15.5.3](classes.md#1553-readonly-fields)), or
12291229
- a `readonly` reference variable or return ([§9.7](variables.md#97-reference-variables-and-returns)),

0 commit comments

Comments
 (0)