Skip to content

Reorganize how record classes (and structs) are spec'd #1683

Description

@RexJaeschke

During the 2026-05-06 TG2 call, we had a lengthy discussion about whether record is a modifier on a class/struct, or a different type entirely. We ended up with the following position:

  1. We'll treat record as a modifier. (This is how it is currently treated in Draft PR #1458.)
  2. Add a new subclause to the end of 15, “Classes” that describes the diffs between a record class and a non-record class, and remove from the current Draft PR mentions of “record [class]” in earlier subclauses in that clause. This allows all information about a record class to be found in one subclause rather than it being spread around multiple earlier subclauses. A reader of the earlier subclauses not interested in record classes will no longer be distracted by text on that topic.
  3. [Repeat for structs] Add a new subclause to the end of 16, “Structs” that describes the diffs between a record struct and a non-record struct, and remove from the current Draft PR mentions of “record struct” in earlier subclauses in that clause. This allows all information about a record struct to be found in one subclause rather than it being spread around multiple earlier subclauses. A reader of the earlier subclauses not interested in record structs will no longer be distracted by text on that topic.

The reorganization needs to accommodate the following:

  1. Addition of record classes in V9.
  2. Addition of record structs in V10.
  3. Allowance of primary constructors in non-record classes/structs in V12.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions