Skip to content

Commit f5cde7d

Browse files
RexJaeschkeBillWagner
authored andcommitted
add xref links
1 parent 120adbc commit f5cde7d

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

standard/classes.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3351,11 +3351,7 @@ The *member_name* ([§15.6.1](classes.md#1561-general)) specifies the name of th
33513351

33523352
The *type* of a property shall be at least as accessible as the property itself ([§7.5.5](basic-concepts.md#755-accessibility-constraints)).
33533353

3354-
<<<<<<< HEAD
33553354
A *property_body* may either consist of a statement body or an expression body. In a statement body, *accessor_declarations*, which shall be enclosed in “`{`” and “`}`” tokens, declare the accessors ([§15.7.3](classes.md#1573-accessors)) of the property. The accessors specify the executable statements associated with reading and writing the property.
3356-
=======
3357-
A *property_body* may either consist of a ***statement body*** or an expression body. In a statement body, *accessor_declarations*, which shall be enclosed in “`{`” and “`}`” tokens, declare the accessors ([§15.7.3](classes.md#1573-accessors)) of the property. The accessors specify the executable statements associated with reading and writing the property.
3358-
>>>>>>> f62f619 (fix formatting, add xref links)
33593355

33603356
In a *property_body* an expression body consisting of `=>` followed by an *expression* `E` and a semicolon is exactly equivalent to the statement body `{ get { return E; } }`, and can therefore only be used to specify read-only properties where the result of the get accessor is given by a single expression.
33613357

@@ -3782,11 +3778,11 @@ Properties can be used to delay initialization of a resource until the moment it
37823778
37833779
An instance property containing an *init_accessor_declaration* is considered settable during the construction phase of the object, except when in a local function or lambda. The ***construction phase of an object*** includes the following:
37843780
3785-
- During execution of an *object_initializer* ([§12.8.16.3](expressions.md#128163-object-initializers))
3781+
- During execution of an *object_initializer* (§12.8.17.2.2)
37863782
- During evaluation of a *with_expression*s *member_initializer_list* ([§xxx](plug in here link to v9 records grammar))
37873783
- Inside an instance constructor of the containing or derived type, on `this` or `base`
37883784
- Inside the *init_accessor_declaration* of any property, on `this` or `base`
3789-
- Inside attribute usages with named parameters (22.2.3](attributes.md#2223-positional-and-named-parameters))
3785+
- Inside attribute usages with named parameters (§23.2.3)
37903786
37913787
> *Example*: Consider the following:
37923788
>
@@ -4800,7 +4796,6 @@ Indexers and properties are very similar in concept, but differ in the following
48004796
- A get accessor of a property corresponds to a method with no parameters, whereas a get accessor of an indexer corresponds to a method with the same parameter list as the indexer.
48014797
- A set accessor of a property corresponds to a method with a single parameter named `value`, whereas a set accessor of an indexer corresponds to a method with the same parameter list as the indexer, plus an additional parameter named `value`.
48024798
- An init accessor of a property corresponds to a method with a single parameter named `value`, whereas an init accessor of an indexer corresponds to a method with the same formal parameter list as the indexer, plus an additional parameter named `value`.
4803-
>>>>>>> aa71ab7 (Add support for init accessors)
48044799
- It is a compile-time error for an indexer accessor to declare a local variable or local constant with the same name as an indexer parameter.
48054800
- In an overriding property declaration, the inherited property is accessed using the syntax `base.P`, where `P` is the property name. In an overriding indexer declaration, the inherited indexer is accessed using the syntax `base[E]`, where `E` is a comma-separated list of expressions.
48064801
- There is no concept of anautomatically implemented indexer.” It is an error to have a non-abstract, non-external indexer with semicolon *accessor_body*s.

standard/expressions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,23 +454,23 @@ Once a particular function member has been identified at binding-time, possibly
454454
> </tr>
455455
> <tr>
456456
> <td><code>P = value</code></td>
457-
> <td>Scenario 1: The set accessor of the property <code>P</code> in the containing class or struct is invoked with the argument list <code>(value)</code>. A compile-time error occurs if <code>P</code> is read-only. If <code>P</code> is not <code>static</code>, the instance expression is <code>this</code>. Scenario 2: The init accessor of the property <code>P</code> in the containing class or struct is invoked with the argument list <code>(value)</code>. A compile-time error occurs if this usage is not during the construction phase of an object.</td>
457+
> <td>Scenario 1: The set accessor of the property <code>P</code> in the containing class or struct is invoked with the argument list <code>(value)</code>. A compile-time error occurs if <code>P</code> is read-only. If <code>P</code> is not <code>static</code>, the instance expression is <code>this</code>. Scenario 2: The init accessor of the property <code>P</code> in the containing class or struct is invoked with the argument list <code>(value)</code>. A compile-time error occurs if this usage is not during the construction phase of an objectinit-accessors).</td>
458458
> </tr>
459459
> <tr>
460460
> <td><code>T.P</code></td>
461461
> <td>The get accessor of the property <code>P</code> in the class or struct <code>T</code> is invoked. A compile-time error occurs if <code>P</code> is not <code>static</code> or if <code>P</code> is write-only or init-only.</td>
462462
> </tr>
463463
> <tr>
464464
> <td><code>T.P = value</code></td>
465-
> <td>Scenario 1: The set accessor of the property <code>P</code> in the class or struct <code>T</code> is invoked with the argument list <code>(value)</code>. A compile-time error occurs if <code>P</code> is not <code>static</code> or if <code>P</code> is read-only. Scenario 2: The init accessor of the property <code>P</code> in the class or struct <code>T</code> is invoked with the argument list <code>(value)</code>. A compile-time error occurs if <code>P</code> is not <code>static</code> or if this usage is not during the construction phase of an object.</td>
465+
> <td>Scenario 1: The set accessor of the property <code>P</code> in the class or struct <code>T</code> is invoked with the argument list <code>(value)</code>. A compile-time error occurs if <code>P</code> is not <code>static</code> or if <code>P</code> is read-only. Scenario 2: The init accessor of the property <code>P</code> in the class or struct <code>T</code> is invoked with the argument list <code>(value)</code>. A compile-time error occurs if <code>P</code> is not <code>static</code> or if this usage is not during the construction phase of an objectinit-accessors).</td>
466466
> </tr>
467467
> <tr>
468468
> <td><code>e.P</code></td>
469469
> <td>The get accessor of the property <code>P</code> in the class, struct, or interface given by the type of <code>E</code> is invoked with the instance expression <code>e</code>. A binding-time error occurs if <code>P</code> is <code>static</code> or if <code>P</code> is write-only or init-only.</td>
470470
> </tr>
471471
> <tr>
472472
> <td><code>e.P = value</code></td>
473-
> <td>Scenario 1: The set accessor of the property <code>P</code> in the class, struct, or interface given by the type of <code>E</code> is invoked with the instance expression <code>e</code> and the argument list <code>(value)</code>. A binding-time error occurs if <code>P</code> is <code>static</code> or if <code>P</code> is read-only. Scenario 2: The init accessor of the property <code>P</code> in the class, struct, or interface given by the type of <code>E</code> is invoked with the instance expression <code>e</code> and the argument list <code>(value)</code>. A binding-time error occurs if <code>P</code> is <code>static</code> or if this usage is not during the construction phase of an object.</td>
473+
> <td>Scenario 1: The set accessor of the property <code>P</code> in the class, struct, or interface given by the type of <code>E</code> is invoked with the instance expression <code>e</code> and the argument list <code>(value)</code>. A binding-time error occurs if <code>P</code> is <code>static</code> or if <code>P</code> is read-only. Scenario 2: The init accessor of the property <code>P</code> in the class, struct, or interface given by the type of <code>E</code> is invoked with the instance expression <code>e</code> and the argument list <code>(value)</code>. A binding-time error occurs if <code>P</code> is <code>static</code> or if this usage is not during the construction phase of an objectinit-accessors).</td>
474474
> </tr>
475475
> <tr>
476476
> <td rowspan="6">Event access</td>
@@ -504,7 +504,7 @@ Once a particular function member has been identified at binding-time, possibly
504504
> </tr>
505505
> <tr>
506506
> <td><code>e[x, y] = value</code></td>
507-
> <td>Overload resolution is applied to select the best indexer in the class, struct, or interface given by the type of <code>e</code>. Scenario 1: The set accessor of the indexer is invoked with the instance expression <code>e</code> and the argument list <code>(x, y, value)</code>. A binding-time error occurs if the indexer is read-only. Scenario 2: The init accessor of the indexer is invoked with the instance expression <code>e</code> and the argument list <code>(x, y, value)</code>. A binding-time error occurs if this usage is not during the construction phase of an object.</td>
507+
> <td>Overload resolution is applied to select the best indexer in the class, struct, or interface given by the type of <code>e</code>. Scenario 1: The set accessor of the indexer is invoked with the instance expression <code>e</code> and the argument list <code>(x, y, value)</code>. A binding-time error occurs if the indexer is read-only. Scenario 2: The init accessor of the indexer is invoked with the instance expression <code>e</code> and the argument list <code>(x, y, value)</code>. A binding-time error occurs if this usage is not during the construction phase of an objectinit-accessors).</td>
508508
> </tr>
509509
> <tr>
510510
> <td rowspan="2">Operator invocation</td>

0 commit comments

Comments
 (0)