Skip to content

Commit c7a111a

Browse files
committed
Correct usages of "final variable" and "constant variable"
1 parent 6069fac commit c7a111a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

specification/dartLangSpec.tex

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,6 @@ \section{Variables}
14191419
is a variable whose declaration includes the modifier \FINAL.
14201420

14211421

1422-
14231422
\subsection{Implicitly Induced Getters and Setters}
14241423
\LMLabel{implicitlyInducedGettersAndSetters}
14251424

@@ -2319,8 +2318,8 @@ \subsection{Formal Parameters}
23192318
the formal parameter scope of $f$.
23202319

23212320
\LMHash{}%
2322-
It is a \Error{compile-time error} if a formal parameter
2323-
is declared as a constant variable (\ref{variables}).
2321+
It is a \Error{compile-time error} if a formal parameter declaration
2322+
has the modifier \CONST.
23242323
% We put the following error here because it's shared among all kinds of
23252324
% functions except one.
23262325
It is a \Error{compile-time error} if an optional formal parameter
@@ -8624,7 +8623,7 @@ \subsection{Constants}
86248623
that is not qualified by a deferred prefix,
86258624
is a potentially constant and constant expression.
86268625
\commentary{%
8627-
For example, if class $C$ declares a constant class variable $v$, !!!TODO!!!
8626+
For example, if class $C$ declares a static constant variable $v$,
86288627
\code{$C$.$v$} is a constant.
86298628
The same is true if $C$ is accessed via a prefix $p$;
86308629
\code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -18948,7 +18947,7 @@ \subsection{Local Variable Declaration}
1894818947
Otherwise, the variable $v$ is bound to $o$.
1894918948

1895018949
\LMHash{}%
18951-
Let $D$ be a \LATE{} and \FINAL{} local variable declaration
18950+
Let $D$ be a \LATE{} and final local variable declaration
1895218951
that declares a variable $v$.
1895318952
If an object $o$ is assigned to $v$
1895418953
in a situation where $v$ is unbound
@@ -19272,7 +19271,7 @@ \subsubsection{For-in}
1927219271
It follows that it is a compile-time error
1927319272
% The following error exists also in the case where \id{} is definitely
1927419273
% unassigned before the loop: The loop could run >1 time.
19275-
if $D$ is empty and \id{} is a final variable.
19274+
if $D$ is empty and \id{} is a final or constant variable.
1927619275
Also, it is a dynamic error if $e$ has type \DYNAMIC,
1927719276
but $e$ evaluates to an instance of a type
1927819277
which is not a subtype of \code{Iterable<Object?>}.%

0 commit comments

Comments
 (0)