Skip to content

Commit 5b30890

Browse files
eernstgnatebosch
andauthored
Specify precisely where it is an error to declare an initializing formal (#3517)
Specify precisely where it is an error to declare an initializing formal parameter (this used to be commentary, should be normative). Co-authored-by: Nate Bosch <[email protected]>
1 parent 06800d6 commit 5b30890

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

specification/dartLangSpec.tex

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
% - Broaden the grammar rule about `initializerExpression` to match the
4848
% implemented behavior. Specify that an initializer expression can not be
4949
% a function literal.
50+
% - Specify in which situations it is an error to declare an initializing
51+
% formal parameter.
5052
%
5153
% Nov 2023
5254
% - Specify that the dynamic error for calling a function in a deferred and
@@ -4003,12 +4005,12 @@ \subsubsection{Generative Constructors}
40034005
It is a compile-time error if \id{} is not also the name of
40044006
an instance variable of the immediately enclosing class or enum.
40054007

4006-
\commentary{%
4007-
Note that it is a compile-time error for an initializing formal
4008-
to occur in any function which is not a non-redirecting generative constructor
4009-
(\ref{requiredFormals}),
4010-
so there is always an enclosing class or enum.%
4011-
}
4008+
\LMHash{}%
4009+
It is a compile-time error for an initializing formal parameter
4010+
to occur in any function which is not a generative constructor.
4011+
Also, it is a compile-time error for an initializing formal parameter
4012+
to occur in a redirecting or external constructor.
4013+
\commentary{In particuar, there is always an enclosing class or enum.}
40124014

40134015
\LMHash{}%
40144016
Assume that $p$ is a declaration of an initializing formal parameter named \id.

0 commit comments

Comments
 (0)