From 3572fa3ca7178c3e05a5957b721795afd9a2b5f6 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Thu, 16 Jan 2020 13:18:37 -0800 Subject: [PATCH 1/3] Update records-wip.md --- proposals/records-wip.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/proposals/records-wip.md b/proposals/records-wip.md index 296693e0bb..28817c1294 100644 --- a/proposals/records-wip.md +++ b/proposals/records-wip.md @@ -41,22 +41,23 @@ In addition to the members declared in the class-body, a record type has the fol 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. If a constructor with the same signature is -already present in the class, the synthesized primary constructor is suppressed. +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 +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)); then -2. executes the instance field initializers appearing in the class-body; and then - invokes the base class constructor with no arguments. [ ] 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) public property with a get accessor and with this name and type is explicitly declared or inherited, it is produced by the compiler as follows: +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: -For a record struct or a sealed record class: +For a record struct or a record class: * A public get-only auto-property is created. Its value is initialized during construction with the value of the corresponding primary constructor parameter. Each "matching" inherited virtual property's get accessor is overridden. From f217053c016ec94520e0ce23b1760d8ffae5bbfd Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Thu, 16 Jan 2020 13:35:17 -0800 Subject: [PATCH 2/3] Update records-wip.md --- proposals/records-wip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/records-wip.md b/proposals/records-wip.md index 28817c1294..e8537e9001 100644 --- a/proposals/records-wip.md +++ b/proposals/records-wip.md @@ -59,5 +59,5 @@ For each record parameter of a record type declaration there is a corresponding For a record struct or a record class: -* A public get-only auto-property is created. Its value is initialized during construction with the value of the corresponding primary constructor parameter. Each "matching" inherited virtual property's get accessor is overridden. +* A public get-only auto-property is created. Its value is initialized during construction with the value of the corresponding primary constructor parameter. Each "matching" inherited abstract property's get accessor is overridden. From e6a3c82ce73cbac71809cedf57b701583db10528 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Mon, 27 Jan 2020 12:58:22 -0800 Subject: [PATCH 3/3] Update records-wip.md --- proposals/records-wip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/records-wip.md b/proposals/records-wip.md index e8537e9001..b7a24dd77d 100644 --- a/proposals/records-wip.md +++ b/proposals/records-wip.md @@ -48,7 +48,7 @@ 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)); then +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