From 1cca522b9b4c2b015d3c9b18de26d41507f381f9 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Mon, 6 Apr 2020 16:56:29 -0700 Subject: [PATCH] Update records-wip.md --- proposals/records-wip.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/proposals/records-wip.md b/proposals/records-wip.md index fd7668e..a96d3f4 100644 --- a/proposals/records-wip.md +++ b/proposals/records-wip.md @@ -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. \ No newline at end of file +in order of definition of the `With` method parameters.