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,
@@ -783,7 +777,7 @@ \section{Notation}
783777Type inference of $e_j$ and the context type used for inference of $e_j$
784778are not relevant.
785779It is generally assumed that type inference has occurred already
786- (\ref{overview }).%
780+ (\ref{typeInference }).%
787781}
788782
789783\LMHash{}%
@@ -1397,13 +1391,6 @@ \section{Variables}
13971391That is, any kind of variable which is not a local variable.%
13981392}
13991393
1400- \LMHash{}%
1401- A \IndexCustom{non-local variable}{variable!non-local}
1402- is a library variable, a class variable, or an instance variable.
1403- \commentary{%
1404- That is, any kind of variable which is not a local variable.%
1405- }
1406-
14071394\LMHash{}%
14081395A \IndexCustom{constant variable}{variable!constant}
14091396is a variable whose declaration includes the modifier \CONST.
@@ -1441,15 +1428,12 @@ \section{Variables}
14411428\subsection{Implicitly Induced Getters and Setters}
14421429\LMLabel{implicitlyInducedGettersAndSetters}
14431430
1444- %% TODO(eernst): When inference is specified, we should be able to conclude
1445- %% that the cases with no declared type do not exist after type inference
1446- %% (for instance `var x;` or `var x = e;`), and then we can replace all rules
1447- %% about such cases by commentary saying that they may exist in the input,
1448- %% but they are gone after type inference.
1449- %%
1450- %% At this time we rely on the assumption that type inference has already
1451- %% occurred, which means that we can refer to the declared type of a variable
1452- %% without mentioning type inference.
1431+ %% TODO(eernst): We treat type inference as a step that has already
1432+ %% taken place. We consider the types chosen by type inference to
1433+ %% be available as a kind of semantic attributes of the syntax.
1434+ %% That is, we can refer to the inferred type and say that the
1435+ %% given declaration has the inferred type. In this way we avoid
1436+ %% talking about an actual syntactic transformation.
14531437
14541438\LMHash{}%
14551439The following rules on implicitly induced getters and setters
@@ -1495,7 +1479,8 @@ \subsection{Implicitly Induced Getters and Setters}
14951479
14961480\noindent
14971481implicitly induces a getter with the header that
1498- contains \STATIC{} if{}f the declaration contains \STATIC{} and is followed by
1482+ contains \STATIC{} if{}f the declaration contains \STATIC,
1483+ and is followed by
14991484\code{$T$\,\,\GET\,\,\id},
15001485where $T$ is obtained from type inference
15011486in the case where $e$ exists,
@@ -1538,7 +1523,7 @@ \subsection{Implicitly Induced Getters and Setters}
15381523\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)},
15391524whose execution sets the value of \id{} to the incoming argument $x$.
15401525The type $T$ is obtained from type inference
1541- (\ref{overview }).
1526+ (\ref{typeInference }).
15421527\EndCase
15431528
15441529\LMHash{}%
@@ -1551,10 +1536,10 @@ \subsection{Implicitly Induced Getters and Setters}
15511536
15521537\commentary{%
15531538Type inference has not yet been specified in this document
1554- (\ref{overview }).
1555- Note that type inference could change , e.g.,
1556- \code{\VAR\,\,x;} to \code{ $T$\,\,x;} ,
1557- which would take us to an earlier case .%
1539+ (\ref{typeInference }).
1540+ Note that type inference could provide , e.g.,
1541+ \code{\VAR\,\,x;} with an inferred type $T$,
1542+ which is then the declared type of the variable .%
15581543}
15591544\EndCase
15601545
@@ -1563,7 +1548,7 @@ \subsection{Implicitly Induced Getters and Setters}
15631548A variable declaration of the form
15641549\code{\STATIC?\,\,\LATE\,\,\FINAL\,\,$T$\,\,\id;}
15651550implicitly induces a setter (\ref{setters}) with the header
1566- \code{\VOID\,\,\SET\,\,\id(\DYNAMIC \,\,$x$)}.
1551+ \code{\VOID\,\,\SET\,\,\id($T$ \,\,$x$)}.
15671552If this setter is executed
15681553in a situation where the variable \id{} has not been bound,
15691554it will bind \id{} to the object that $x$ is bound to.
@@ -1961,9 +1946,6 @@ \subsection{Evaluation of Implicit Variable Getters}
19611946% Reduce whitespace after itemized list: This is just an end symbol.
19621947\vspace{-\baselineskip}\EndCase
19631948
1964- % Reduce whitespace after itemized list: This is just an end symbol.
1965- \vspace{-\baselineskip}\EndCase
1966-
19671949
19681950\section{Functions}
19691951\LMLabel{functions}
@@ -5119,12 +5101,11 @@ \subsubsection{Inheritance and Overriding}
51195101
51205102\item There is only one namespace
51215103 for getters, setters, methods and constructors (\ref{scoping}).
5122- A non-local variable $f$ introduces a getter $f$,
5123- and a non-local variable $f$
5124- also introduces a setter
5104+ A non-local variable $f$ introduces a getter $f$.
5105+ A non-local variable $f$ also introduces a setter \code{$f$=}
51255106 if it is not final and not constant,
51265107 or it is late and final and has no initializing expression
5127- \code{$f$=} (\ref{instanceVariables}, \ref{variables}).
5108+ (\ref{instanceVariables}, \ref{variables}).
51285109 When we speak of members here, we mean
51295110 accessible instance, static, or library variables,
51305111 getters, setters, and methods
@@ -8656,7 +8637,7 @@ \subsection{Constants}
86568637 that is not qualified by a deferred prefix,
86578638 is a potentially constant and constant expression.
86588639 \commentary{%
8659- For example, if class $C$ declares a constant class variable $v$,
8640+ For example, if class $C$ declares a constant class variable $v$, !!!TODO!!!
86608641 \code{$C$.$v$} is a constant.
86618642 The same is true if $C$ is accessed via a prefix $p$;
86628643 \code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -12283,7 +12264,7 @@ \subsection{This}
1228312264
1228412265\LMHash{}%
1228512266The static type of \THIS{} is the interface of the
12286- immediately enclosing class, enum , or mixin , if any.
12267+ immediately enclosing class, mixin , or enum , if any.
1228712268The static type of \THIS{} is
1228812269the \ON{} type of the enclosing extension, if any
1228912270(\ref{extensions}).
@@ -16305,7 +16286,7 @@ \subsection{Assignment}
1630516286
1630616287\LMHash{}%
1630716288An assignment changes the value associated with a variable,
16308- or invokes a setter.
16289+ or it invokes a setter.
1630916290
1631016291\begin{grammar}
1631116292<assignmentOperator> ::= `='
@@ -18770,7 +18751,8 @@ \subsection{Local Variable Declaration}
1877018751
1877118752\LMHash{}%
1877218753The properties of being
18773- \IndexCustom{initialized}{variable!initialized} or
18754+ \IndexCustom{initialized}{variable!initialized},
18755+ \IndexCustom{final}{variable!final}, or
1877418756\IndexCustom{constant}{variable!constant}
1877518757apply to local variables with the same definitions as for other variables
1877618758(\ref{variables}).
@@ -18862,7 +18844,7 @@ \subsection{Local Variable Declaration}
1886218844
1886318845In every situation which is not covered by the previous paragraph,
1886418846it is a compile-time error to assign to a local variable
18865- which is \FINAL{} and not \LATE{}
18847+ which is final and not late
1886618848(\ref{assignment}).%
1886718849}
1886818850
@@ -22034,10 +22016,13 @@ \subsection{Dynamic Type System}
2203422016}
2203522017
2203622018\LMHash{}%
22037- An expression is a \emph {type literal} if it is an identifier,
22019+ An expression is a \Index {type literal} if it is an identifier,
2203822020or a qualified identifier,
2203922021which denotes a class, mixin, enum, or type alias declaration, or it is
22040- an identifier denoting a type parameter of a generic class or function.
22022+ an identifier denoting a type parameter of a generic class or function,
22023+ or it is an identifier or qualified identifier which is a type literal
22024+ and which is followed by a list of actual type arguments
22025+ derived from \synt{typeArguments}.
2204122026It is a \emph{constant type literal} if it does not denote a type parameter,
2204222027and it is not qualified by a deferred prefix.
2204322028\commentary{%
0 commit comments