Skip to content

Commit

Permalink
Correct usages of "final variable" and "constant variable"
Browse files Browse the repository at this point in the history
  • Loading branch information
eernstg committed Aug 8, 2023
1 parent bc95629 commit e922a06
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions specification/dartLangSpec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,6 @@ \section{Variables}
is a variable whose declaration includes the modifier \FINAL.



\subsection{Implicitly Induced Getters and Setters}
\LMLabel{implicitlyInducedGettersAndSetters}

Expand Down Expand Up @@ -2334,8 +2333,8 @@ \subsection{Formal Parameters}
the formal parameter scope of $f$.

\LMHash{}%
It is a \Error{compile-time error} if a formal parameter
is declared as a constant variable (\ref{variables}).
It is a \Error{compile-time error} if a formal parameter declaration
has the modifier \CONST.
% We put the following error here because it's shared among all kinds of
% functions except one.
It is a \Error{compile-time error} if an optional formal parameter
Expand Down Expand Up @@ -8637,7 +8636,7 @@ \subsection{Constants}
that is not qualified by a deferred prefix,
is a potentially constant and constant expression.
\commentary{%
For example, if class $C$ declares a constant class variable $v$, !!!TODO!!!
For example, if class $C$ declares a static constant variable $v$,
\code{$C$.$v$} is a constant.
The same is true if $C$ is accessed via a prefix $p$;
\code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
Expand Down Expand Up @@ -18962,7 +18961,7 @@ \subsection{Local Variable Declaration}
Otherwise, the variable $v$ is bound to $o$.

\LMHash{}%
Let $D$ be a \LATE{} and \FINAL{} local variable declaration
Let $D$ be a \LATE{} and final local variable declaration
that declares a variable $v$.
If an object $o$ is assigned to $v$
in a situation where $v$ is unbound
Expand Down Expand Up @@ -19286,7 +19285,7 @@ \subsubsection{For-in}
It follows that it is a compile-time error
% The following error exists also in the case where \id{} is definitely
% unassigned before the loop: The loop could run >1 time.
if $D$ is empty and \id{} is a final variable.
if $D$ is empty and \id{} is a final or constant variable.
Also, it is a dynamic error if $e$ has type \DYNAMIC,
but $e$ evaluates to an instance of a type
which is not a subtype of \code{Iterable<Object?>}.%
Expand Down

0 comments on commit e922a06

Please sign in to comment.