From e922a0610583c64e7417bbc2904ab3745e2248de Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Fri, 21 Jul 2023 17:32:56 +0200 Subject: [PATCH] Correct usages of "final variable" and "constant variable" --- specification/dartLangSpec.tex | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/specification/dartLangSpec.tex b/specification/dartLangSpec.tex index de7ccbfb4c..3dd2183ffd 100644 --- a/specification/dartLangSpec.tex +++ b/specification/dartLangSpec.tex @@ -1424,7 +1424,6 @@ \section{Variables} is a variable whose declaration includes the modifier \FINAL. - \subsection{Implicitly Induced Getters and Setters} \LMLabel{implicitlyInducedGettersAndSetters} @@ -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 @@ -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.% @@ -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 @@ -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}.%