Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions standard/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class_declaration

class_tag
: 'class'
| 'record'
| 'record' 'class'?
;
```

Expand All @@ -31,7 +31,7 @@ A class declaration shall not supply *type_parameter_constraints_clause*s unless

A class declaration that supplies a *type_parameter_list* is a generic class declaration. Additionally, any class nested inside a generic class declaration or a generic struct declaration is itself a generic class declaration, since type arguments for the containing type shall be supplied to create a constructed type ([§8.4](types.md#84-constructed-types)).

If *class_tag* contains `record`, that class is a ***record class***; otherwise, it is a ***non-record class***.
If *class_tag* contains `record`, that class is a ***record class***; otherwise, it is a ***non-record class***. `record` and `record class` are equivalent.

For a record class, *class_modifier* shall not be `static`.

Expand Down Expand Up @@ -6465,7 +6465,9 @@ Expression variables declared in *argument_list* are in scope within the *argume

#### 15.16.5.3 Properties

For each parameter of a positional *record_declaration* ([§15.2.1](classes.md#1521-general)) there shall be a corresponding public property member whose name and type are taken from the value parameter declaration.
For each parameter of a positional *record_declaration* ([§15.2.1](classes.md#1521-general)) that has the same name and type as an inherited or explicitly declared instance field, the remainder of this subclause does not apply.

For each parameter of a positional *record_declaration* there shall be a corresponding public property member whose name and type are taken from the value parameter declaration.

For a record class:

Expand Down Expand Up @@ -6520,6 +6522,3 @@ A positional record class ([§15.2.1](classes.md#1521-general)) with at least on
> ```
>
> *end example*



7 changes: 4 additions & 3 deletions standard/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@

> *Example*: For the operation `b * s`, where `b` is a `byte` and `s` is a `short`, overload resolution selects `operator *(int, int)` as the best operator. Thus, the effect is that `b` and `s` are converted to `int`, and the type of the result is `int`. Likewise, for the operation `i * d`, where `i` is an `int` and `d` is a `double`, `overload` resolution selects `operator *(double, double)` as the best operator. *end example*


Check failure on line 294 in standard/expressions.md

View workflow job for this annotation

GitHub Actions / lint

Multiple consecutive blank lines

standard/expressions.md:294 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md
**End of informative text.**

#### 12.4.7.2 Unary numeric promotions
Expand Down Expand Up @@ -3901,7 +3901,7 @@

## 12.10 With expressions

A *with_expression* allows for ***non-destructive mutation*** by making a new record class instance that is a copy of an existing record class instance, optionally with specified properties and fields modified.
A *with_expression* allows for ***non-destructive mutation*** by making a new record class, record struct, or non-record struct instance that is a copy of an existing record class, record struct, or non-record struct instance, respectively, optionally with specified properties and fields modified.

```ANTLR
with_expression
Expand All @@ -3912,15 +3912,16 @@

A *with_expression* is not permitted as a statement.

The receiver type shall be non-`void` and of some record class type.
The receiver type shall be non-`void` and of some record class, record struct, or non-record struct type.

*identifier* shall be an accessible instance field or property of the receiver's type.

All non-positional properties being changed shall have both set and init accessors.

This expression is evaluated as follows:

- The receiver's clone method ([§15.16.3](classes.md#15163-copy-and-clone-members)) is invoked, and its result is converted to the receiver’s type.
- For a record class type, the receiver's clone method ([§15.16.3](classes.md#15163-copy-and-clone-members)) is invoked, and its result is converted to the receiver’s type.
- For a record struct or non-record struct type, the receiver is copied.
- Each `member_initializer` is processed the same way as an assignment to
a field or property access of the result of the conversion. Assignments are processed in lexical order. If *member_initializer_list* is omitted, no members are changed.

Expand Down
Loading
Loading