From acf550612fd5c874f4b66835eda5de5eb0e6c826 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 ea36839973..b30ce48e10 100644 --- a/specification/dartLangSpec.tex +++ b/specification/dartLangSpec.tex @@ -1429,7 +1429,6 @@ \section{Variables} is a variable whose declaration includes the modifier \FINAL. - \subsection{Implicitly Induced Getters and Setters} \LMLabel{implicitlyInducedGettersAndSetters} @@ -2339,8 +2338,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 @@ -8642,7 +8641,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.% @@ -18971,7 +18970,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 @@ -19295,7 +19294,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}.%