2626% CHANGES
2727% =======
2828%
29- % Significant changes to the specification. Note that the versions specified
30- % below indicate the current tool chain version when those changes were made.
31- % In practice, new features have always been integrated into the language
32- % specification (this document) a while after the change was accepted into
33- % the language and implemented. As of September 2022, the upcoming version of
34- % the language which is being specified is indicated by a version number in
35- % parentheses after the tool chain version.
29+ % Significant changes to the specification.
3630%
3731% Note that the version numbers used below (up to 2.15) were associated with
3832% the currently released language and tools at the time of the spec change,
@@ -788,7 +782,7 @@ \section{Notation}
788782Type inference of $e_j$ and the context type used for inference of $e_j$
789783are not relevant.
790784It is generally assumed that type inference has occurred already
791- (\ref{overview }).%
785+ (\ref{typeInference }).%
792786}
793787
794788\LMHash{}%
@@ -1402,13 +1396,6 @@ \section{Variables}
14021396That is, any kind of variable which is not a local variable.%
14031397}
14041398
1405- \LMHash{}%
1406- A \IndexCustom{non-local variable}{variable!non-local}
1407- is a library variable, a class variable, or an instance variable.
1408- \commentary{%
1409- That is, any kind of variable which is not a local variable.%
1410- }
1411-
14121399\LMHash{}%
14131400A \IndexCustom{constant variable}{variable!constant}
14141401is a variable whose declaration includes the modifier \CONST.
@@ -1446,15 +1433,12 @@ \section{Variables}
14461433\subsection{Implicitly Induced Getters and Setters}
14471434\LMLabel{implicitlyInducedGettersAndSetters}
14481435
1449- %% TODO(eernst): When inference is specified, we should be able to conclude
1450- %% that the cases with no declared type do not exist after type inference
1451- %% (for instance `var x;` or `var x = e;`), and then we can replace all rules
1452- %% about such cases by commentary saying that they may exist in the input,
1453- %% but they are gone after type inference.
1454- %%
1455- %% At this time we rely on the assumption that type inference has already
1456- %% occurred, which means that we can refer to the declared type of a variable
1457- %% without mentioning type inference.
1436+ %% TODO(eernst): We treat type inference as a step that has already
1437+ %% taken place. We consider the types chosen by type inference to
1438+ %% be available as a kind of semantic attributes of the syntax.
1439+ %% That is, we can refer to the inferred type and say that the
1440+ %% given declaration has the inferred type. In this way we avoid
1441+ %% talking about an actual syntactic transformation.
14581442
14591443\LMHash{}%
14601444The following rules on implicitly induced getters and setters
@@ -1500,7 +1484,8 @@ \subsection{Implicitly Induced Getters and Setters}
15001484
15011485\noindent
15021486implicitly induces a getter with the header that
1503- contains \STATIC{} if{}f the declaration contains \STATIC{} and is followed by
1487+ contains \STATIC{} if{}f the declaration contains \STATIC,
1488+ and is followed by
15041489\code{$T$\,\,\GET\,\,\id},
15051490where $T$ is obtained from type inference
15061491in the case where $e$ exists,
@@ -1543,7 +1528,7 @@ \subsection{Implicitly Induced Getters and Setters}
15431528\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)},
15441529whose execution sets the value of \id{} to the incoming argument $x$.
15451530The type $T$ is obtained from type inference
1546- (\ref{overview }).
1531+ (\ref{typeInference }).
15471532\EndCase
15481533
15491534\LMHash{}%
@@ -1556,10 +1541,10 @@ \subsection{Implicitly Induced Getters and Setters}
15561541
15571542\commentary{%
15581543Type inference has not yet been specified in this document
1559- (\ref{overview }).
1560- Note that type inference could change , e.g.,
1561- \code{\VAR\,\,x;} to \code{ $T$\,\,x;} ,
1562- which would take us to an earlier case .%
1544+ (\ref{typeInference }).
1545+ Note that type inference could provide , e.g.,
1546+ \code{\VAR\,\,x;} with an inferred type $T$,
1547+ which is then the declared type of the variable .%
15631548}
15641549\EndCase
15651550
@@ -1568,7 +1553,7 @@ \subsection{Implicitly Induced Getters and Setters}
15681553A variable declaration of the form
15691554\code{\STATIC?\,\,\LATE\,\,\FINAL\,\,$T$\,\,\id;}
15701555implicitly induces a setter (\ref{setters}) with the header
1571- \code{\VOID\,\,\SET\,\,\id(\DYNAMIC \,\,$x$)}.
1556+ \code{\VOID\,\,\SET\,\,\id($T$ \,\,$x$)}.
15721557If this setter is executed
15731558in a situation where the variable \id{} has not been bound,
15741559it will bind \id{} to the object that $x$ is bound to.
@@ -1966,9 +1951,6 @@ \subsection{Evaluation of Implicit Variable Getters}
19661951% Reduce whitespace after itemized list: This is just an end symbol.
19671952\vspace{-\baselineskip}\EndCase
19681953
1969- % Reduce whitespace after itemized list: This is just an end symbol.
1970- \vspace{-\baselineskip}\EndCase
1971-
19721954
19731955\section{Functions}
19741956\LMLabel{functions}
@@ -5124,12 +5106,11 @@ \subsubsection{Inheritance and Overriding}
51245106
51255107\item There is only one namespace
51265108 for getters, setters, methods and constructors (\ref{scoping}).
5127- A non-local variable $f$ introduces a getter $f$,
5128- and a non-local variable $f$
5129- also introduces a setter
5109+ A non-local variable $f$ introduces a getter $f$.
5110+ A non-local variable $f$ also introduces a setter \code{$f$=}
51305111 if it is not final and not constant,
51315112 or it is late and final and has no initializing expression
5132- \code{$f$=} (\ref{instanceVariables}, \ref{variables}).
5113+ (\ref{instanceVariables}, \ref{variables}).
51335114 When we speak of members here, we mean
51345115 accessible instance, static, or library variables,
51355116 getters, setters, and methods
@@ -8661,7 +8642,7 @@ \subsection{Constants}
86618642 that is not qualified by a deferred prefix,
86628643 is a potentially constant and constant expression.
86638644 \commentary{%
8664- For example, if class $C$ declares a constant class variable $v$,
8645+ For example, if class $C$ declares a constant class variable $v$, !!!TODO!!!
86658646 \code{$C$.$v$} is a constant.
86668647 The same is true if $C$ is accessed via a prefix $p$;
86678648 \code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -12288,7 +12269,7 @@ \subsection{This}
1228812269
1228912270\LMHash{}%
1229012271The static type of \THIS{} is the interface of the
12291- immediately enclosing class, enum , or mixin , if any.
12272+ immediately enclosing class, mixin , or enum , if any.
1229212273The static type of \THIS{} is
1229312274the \ON{} type of the enclosing extension, if any
1229412275(\ref{extensions}).
@@ -16310,7 +16291,7 @@ \subsection{Assignment}
1631016291
1631116292\LMHash{}%
1631216293An assignment changes the value associated with a variable,
16313- or invokes a setter.
16294+ or it invokes a setter.
1631416295
1631516296\begin{grammar}
1631616297<assignmentOperator> ::= `='
@@ -18779,7 +18760,8 @@ \subsection{Local Variable Declaration}
1877918760
1878018761\LMHash{}%
1878118762The properties of being
18782- \IndexCustom{initialized}{variable!initialized} or
18763+ \IndexCustom{initialized}{variable!initialized},
18764+ \IndexCustom{final}{variable!final}, or
1878318765\IndexCustom{constant}{variable!constant}
1878418766apply to local variables with the same definitions as for other variables
1878518767(\ref{variables}).
@@ -18871,7 +18853,7 @@ \subsection{Local Variable Declaration}
1887118853
1887218854In every situation which is not covered by the previous paragraph,
1887318855it is a compile-time error to assign to a local variable
18874- which is \FINAL{} and not \LATE{}
18856+ which is final and not late
1887518857(\ref{assignment}).%
1887618858}
1887718859
@@ -22045,10 +22027,13 @@ \subsection{Dynamic Type System}
2204522027}
2204622028
2204722029\LMHash{}%
22048- An expression is a \emph {type literal} if it is an identifier,
22030+ An expression is a \Index {type literal} if it is an identifier,
2204922031or a qualified identifier,
2205022032which denotes a class, mixin, enum, or type alias declaration, or it is
22051- an identifier denoting a type parameter of a generic class or function.
22033+ an identifier denoting a type parameter of a generic class or function,
22034+ or it is an identifier or qualified identifier which is a type literal
22035+ and which is followed by a list of actual type arguments
22036+ derived from \synt{typeArguments}.
2205222037It is a \emph{constant type literal} if it does not denote a type parameter,
2205322038and it is not qualified by a deferred prefix.
2205422039\commentary{%
0 commit comments