Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify precisely where it is an error to declare an initializing formal #3517

Merged
merged 4 commits into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions specification/dartLangSpec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
% - 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
Expand Down Expand Up @@ -4003,12 +4005,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 generative constructor.
Also, it is a compile-time error for an initializing formal parameter
to occur in a redirecting or 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.
Expand Down