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,
@@ -846,7 +840,7 @@ \section{Notation}
846840 Type inference of $e_j$ and the context type used for inference of $e_j$
847841 are not relevant.
848842 It is generally assumed that type inference has occurred already
849- (\ref{overview }).%
843+ (\ref{typeInference }).%
850844}
851845
852846\LMHash{}%
@@ -1463,13 +1457,6 @@ \section{Variables}
14631457 That is, any kind of variable which is not a local variable.%
14641458}
14651459
1466- \LMHash{}%
1467- A \IndexCustom{non-local variable}{variable!non-local}
1468- is a library variable, a class variable, or an instance variable.
1469- \commentary{%
1470- That is, any kind of variable which is not a local variable.%
1471- }
1472-
14731460\LMHash{}%
14741461A \IndexCustom{constant variable}{variable!constant}
14751462is a variable whose declaration includes the modifier \CONST.
@@ -1505,15 +1492,12 @@ \section{Variables}
15051492\subsection{Implicitly Induced Getters and Setters}
15061493\LMLabel{implicitlyInducedGettersAndSetters}
15071494
1508- %% TODO(eernst): When inference is specified, we should be able to conclude
1509- %% that the cases with no declared type do not exist after type inference
1510- %% (for instance `var x;` or `var x = e;`), and then we can replace all rules
1511- %% about such cases by commentary saying that they may exist in the input,
1512- %% but they are gone after type inference.
1513- %%
1514- %% At this time we rely on the assumption that type inference has already
1515- %% occurred, which means that we can refer to the declared type of a variable
1516- %% without mentioning type inference.
1495+ %% TODO(eernst): We treat type inference as a step that has already
1496+ %% taken place. We consider the types chosen by type inference to
1497+ %% be available as a kind of semantic attributes of the syntax.
1498+ %% That is, we can refer to the inferred type and say that the
1499+ %% given declaration has the inferred type. In this way we avoid
1500+ %% talking about an actual syntactic transformation.
15171501
15181502\LMHash{}%
15191503The following rules on implicitly induced getters and setters
@@ -1559,7 +1543,8 @@ \subsection{Implicitly Induced Getters and Setters}
15591543
15601544\noindent
15611545implicitly induces a getter with the header that
1562- contains \STATIC{} if{}f the declaration contains \STATIC{} and is followed by
1546+ contains \STATIC{} if{}f the declaration contains \STATIC,
1547+ and is followed by
15631548\code{$T$\,\,\GET\,\,\id},
15641549where $T$ is obtained from type inference
15651550in the case where $e$ exists,
@@ -1602,7 +1587,7 @@ \subsection{Implicitly Induced Getters and Setters}
16021587\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)},
16031588whose execution sets the value of \id{} to the incoming argument $x$.
16041589The type $T$ is obtained from type inference
1605- (\ref{overview }).
1590+ (\ref{typeInference }).
16061591\EndCase
16071592
16081593\LMHash{}%
@@ -1615,10 +1600,10 @@ \subsection{Implicitly Induced Getters and Setters}
16151600
16161601\commentary{%
16171602 Type inference has not yet been specified in this document
1618- (\ref{overview }).
1619- Note that type inference could change , e.g.,
1620- \code{\VAR\,\,x;} to \code{ $T$\,\,x;} ,
1621- which would take us to an earlier case .%
1603+ (\ref{typeInference }).
1604+ Note that type inference could provide , e.g.,
1605+ \code{\VAR\,\,x;} with an inferred type $T$,
1606+ which is then the declared type of the variable .%
16221607}
16231608\EndCase
16241609
@@ -1627,7 +1612,7 @@ \subsection{Implicitly Induced Getters and Setters}
16271612A variable declaration of the form
16281613\code{\STATIC?\,\,\LATE\,\,\FINAL\,\,$T$\,\,\id;}
16291614implicitly induces a setter (\ref{setters}) with the header
1630- \code{\VOID\,\,\SET\,\,\id(\DYNAMIC \,\,$x$)}.
1615+ \code{\VOID\,\,\SET\,\,\id($T$ \,\,$x$)}.
16311616If this setter is executed
16321617in a situation where the variable \id{} has not been bound,
16331618it will bind \id{} to the object that $x$ is bound to.
@@ -2026,9 +2011,6 @@ \subsection{Evaluation of Implicit Variable Getters}
20262011% Reduce whitespace after itemized list: This is just an end symbol.
20272012\vspace{-\baselineskip}\EndCase
20282013
2029- % Reduce whitespace after itemized list: This is just an end symbol.
2030- \vspace{-\baselineskip}\EndCase
2031-
20322014
20332015\section{Functions}
20342016\LMLabel{functions}
@@ -5231,14 +5213,14 @@ \subsubsection{Inheritance and Overriding}
52315213 The controlling language is in the relevant sections of the specification.
52325214
52335215 \begin{enumerate}
5216+
52345217 \item There is only one namespace
52355218 for getters, setters, methods and constructors (\ref{scoping}).
5236- A non-local variable $f$ introduces a getter $f$,
5237- and a non-local variable $f$
5238- also introduces a setter
5219+ A non-local variable $f$ introduces a getter $f$.
5220+ A non-local variable $f$ also introduces a setter \code{$f$=}
52395221 if it is not final and not constant,
52405222 or it is late and final and has no initializing expression
5241- \code{$f$=} (\ref{instanceVariables}, \ref{variables}).
5223+ (\ref{instanceVariables}, \ref{variables}).
52425224 When we speak of members here, we mean
52435225 accessible instance, static, or library variables,
52445226 getters, setters, and methods
@@ -8845,7 +8827,7 @@ \subsection{Constants}
88458827 that is not qualified by a deferred prefix,
88468828 is a potentially constant and constant expression.
88478829 \commentary{%
8848- For example, if class $C$ declares a constant class variable $v$,
8830+ For example, if class $C$ declares a constant class variable $v$, !!!TODO!!!
88498831 \code{$C$.$v$} is a constant.
88508832 The same is true if $C$ is accessed via a prefix $p$;
88518833 \code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -12566,7 +12548,7 @@ \subsection{This}
1256612548
1256712549\LMHash{}%
1256812550The static type of \THIS{} is the interface of the
12569- immediately enclosing class, enum , or mixin , if any.
12551+ immediately enclosing class, mixin , or enum , if any.
1257012552The static type of \THIS{} is
1257112553the \ON{} type of the enclosing extension, if any
1257212554(\ref{extensions}).
@@ -16648,7 +16630,7 @@ \subsection{Assignment}
1664816630
1664916631\LMHash{}%
1665016632An assignment changes the value associated with a variable,
16651- or invokes a setter.
16633+ or it invokes a setter.
1665216634
1665316635\begin{grammar}
1665416636<assignmentOperator> ::= `='
@@ -19140,7 +19122,8 @@ \subsection{Local Variable Declaration}
1914019122
1914119123\LMHash{}%
1914219124The properties of being
19143- \IndexCustom{initialized}{variable!initialized} or
19125+ \IndexCustom{initialized}{variable!initialized},
19126+ \IndexCustom{final}{variable!final}, or
1914419127\IndexCustom{constant}{variable!constant}
1914519128apply to local variables with the same definitions as for other variables
1914619129(\ref{variables}).
@@ -19232,7 +19215,7 @@ \subsection{Local Variable Declaration}
1923219215
1923319216 In every situation which is not covered by the previous paragraph,
1923419217 it is a compile-time error to assign to a local variable
19235- which is \FINAL{} and not \LATE{}
19218+ which is final and not late
1923619219 (\ref{assignment}).%
1923719220}
1923819221
@@ -22549,10 +22532,13 @@ \subsection{Dynamic Type System}
2254922532}
2255022533
2255122534\LMHash{}%
22552- An expression is a \emph {type literal} if it is an identifier,
22535+ An expression is a \Index {type literal} if it is an identifier,
2255322536or a qualified identifier,
2255422537which denotes a class, mixin, enum, or type alias declaration, or it is
22555- an identifier denoting a type parameter of a generic class or function.
22538+ an identifier denoting a type parameter of a generic class or function,
22539+ or it is an identifier or qualified identifier which is a type literal
22540+ and which is followed by a list of actual type arguments
22541+ derived from \synt{typeArguments}.
2255622542It is a \emph{constant type literal} if it does not denote a type parameter,
2255722543and it is not qualified by a deferred prefix.
2255822544\commentary{%
0 commit comments