From 4304c7d2bf062a8a2ef29c0590c01d8b2f455940 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Fri, 15 Dec 2023 12:21:00 +0100 Subject: [PATCH 1/4] Specify precisely where it is an error to declare an initializing formal parameter --- specification/dartLangSpec.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/dartLangSpec.tex b/specification/dartLangSpec.tex index a6bc07879..0a5f28f08 100644 --- a/specification/dartLangSpec.tex +++ b/specification/dartLangSpec.tex @@ -4003,12 +4003,12 @@ \subsubsection{Generative Constructors} It is a compile-time error if \id{} is not also the name of an instance variable of the immediately enclosing class or enum. -\commentary{% -Note that it is a compile-time error for an initializing formal -to occur in any function which is not a non-redirecting generative constructor -(\ref{requiredFormals}), -so there is always an enclosing class or enum.% -} +\LMHash{}% +It is a compile-time error for an initializing formal parameter +to occur in any function which is not +a non-redirecting, non-external, generative constructor +(\ref{requiredFormals}). +\commentary{This implies that there is always an enclosing class or enum.} \LMHash{}% Assume that $p$ is a declaration of an initializing formal parameter named \id. From 3572afada3a842468dba1baecb4c891dc0b3955b Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Fri, 15 Dec 2023 12:49:59 +0100 Subject: [PATCH 2/4] Improve wording --- specification/dartLangSpec.tex | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/specification/dartLangSpec.tex b/specification/dartLangSpec.tex index 0a5f28f08..7e12c9dc5 100644 --- a/specification/dartLangSpec.tex +++ b/specification/dartLangSpec.tex @@ -41,6 +41,7 @@ % version of the language which will actually be specified by the next stable % release of this document. % +<<<<<<< HEAD % Dec 2023 % - Allow `~/` on operands of type `double` in constant expressions, aligning % the specification with already implemented behavior. @@ -79,6 +80,13 @@ % - Change the definition of the 'element type of a generator function', due to % soundness issue with the current definition. % +||||||| parent of db1018c (Improve wording) +======= +% Dec 2023 +% - Specify in which situations it is an error to declare an initializing +% formal parameter. +% +>>>>>>> db1018c (Improve wording) % Mar 2023 % - Clarify how line breaks are handled in a multi-line string literal. Rename % the lexical token NEWLINE to LINE\_BREAK (clarifying that it is not `\n`). @@ -4005,10 +4013,10 @@ \subsubsection{Generative Constructors} \LMHash{}% It is a compile-time error for an initializing formal parameter -to occur in any function which is not -a non-redirecting, non-external, generative constructor -(\ref{requiredFormals}). -\commentary{This implies that there is always an enclosing class or enum.} +to occur in any function which is not a generative constructor. +Also, it is a compile-time error for an initializing formal parameter +to occur in a redirecting and in an external constructor. +\commentary{In particuar, there is always an enclosing class or enum.} \LMHash{}% Assume that $p$ is a declaration of an initializing formal parameter named \id. From 829a7cb1f71e73b222d61d3cc531d9864cf9913f Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Fri, 15 Dec 2023 13:01:02 +0100 Subject: [PATCH 3/4] Typo --- specification/dartLangSpec.tex | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/specification/dartLangSpec.tex b/specification/dartLangSpec.tex index 7e12c9dc5..4f660a4cb 100644 --- a/specification/dartLangSpec.tex +++ b/specification/dartLangSpec.tex @@ -41,13 +41,14 @@ % version of the language which will actually be specified by the next stable % release of this document. % -<<<<<<< HEAD % Dec 2023 % - Allow `~/` on operands of type `double` in constant expressions, aligning % the specification with already implemented behavior. % - Broaden the grammar rule about `initializerExpression` to match the % implemented behavior. Specify that an initializer expression can not be % a function literal. +% - Specify in which situations it is an error to declare an initializing +% formal parameter. % % Nov 2023 % - Specify that the dynamic error for calling a function in a deferred and @@ -80,13 +81,6 @@ % - Change the definition of the 'element type of a generator function', due to % soundness issue with the current definition. % -||||||| parent of db1018c (Improve wording) -======= -% Dec 2023 -% - Specify in which situations it is an error to declare an initializing -% formal parameter. -% ->>>>>>> db1018c (Improve wording) % Mar 2023 % - Clarify how line breaks are handled in a multi-line string literal. Rename % the lexical token NEWLINE to LINE\_BREAK (clarifying that it is not `\n`). From a2b122e9f8701560dd338bc7e75542c90bfe16c5 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Mon, 18 Dec 2023 10:49:22 +0100 Subject: [PATCH 4/4] Update specification/dartLangSpec.tex Apply natural language logical operator to property rather than entity (is less verbose). Co-authored-by: Nate Bosch --- specification/dartLangSpec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/dartLangSpec.tex b/specification/dartLangSpec.tex index 4f660a4cb..e06b3fbcc 100644 --- a/specification/dartLangSpec.tex +++ b/specification/dartLangSpec.tex @@ -4009,7 +4009,7 @@ \subsubsection{Generative Constructors} It is a compile-time error for an initializing formal parameter to occur in any function which is not a generative constructor. Also, it is a compile-time error for an initializing formal parameter -to occur in a redirecting and in an external constructor. +to occur in a redirecting or external constructor. \commentary{In particuar, there is always an enclosing class or enum.} \LMHash{}%