Update records-wip.md

This commit is contained in:
Andy Gocke 2020-04-06 16:56:29 -07:00 committed by GitHub
parent 18c41f4cea
commit 1cca522b9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,24 +35,21 @@ It is an error to declare a record type without both a parameter list and the `d
## Members of a record type
In addition to the members declared in the class-body, a record type has the following additional members:
In addition to the members declared in the class or struct body, a record type has the following additional members:
### Primary Constructor
A record type has a public constructor whose signature corresponds to the value parameters of the
type declaration. This is called the primary constructor for the type, and causes the implicitly
declared default constructor to be suppressed. It is an error to have a primary constructor and
a constructor with the same signature already present in the class.
At runtime the primary constructor
declared default constructor to be suppressed (including the struct parameterless constructor).
It is an error to have a primary constructor and a constructor with the same signature already
present in the class. At runtime the primary constructor
1. executes the instance field initializers appearing in the class-body; and then
invokes the base class constructor with no arguments.
1. initializes compiler-generated backing fields for the properties corresponding to the value parameters (if these properties are compiler-provided; see [Synthesized properties](#Synthesized Properties))
[ ] TODO: add base call syntax and specification about choosing base constructor through overload resolution
### Properties
For each record parameter of a record type declaration there is a corresponding public property member whose name and type are taken from the value parameter declaration. If no concrete (i.e. non-abstract) property with a get accessor and with this name and type is explicitly declared or inherited, it is produced by the compiler as follows:
@ -119,4 +116,4 @@ evaluated exactly once:
2. Expressions in the `anonymous_object_initializer`, in lexical order
3. The evaluation of any properties matching the `With` method parameters,
in order of definition of the `With` method parameters.
in order of definition of the `With` method parameters.