26
26
% CHANGES
27
27
% =======
28
28
%
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.
36
30
%
37
31
% Note that the version numbers used below (up to 2.15) were associated with
38
32
% the currently released language and tools at the time of the spec change,
@@ -837,7 +831,7 @@ \section{Notation}
837
831
Type inference of $e_j$ and the context type used for inference of $e_j$
838
832
are not relevant.
839
833
It is generally assumed that type inference has occurred already
840
- (\ref{overview }).%
834
+ (\ref{typeInference }).%
841
835
}
842
836
843
837
\LMHash{}%
@@ -1454,13 +1448,6 @@ \section{Variables}
1454
1448
That is, any kind of variable which is not a local variable.%
1455
1449
}
1456
1450
1457
- \LMHash{}%
1458
- A \IndexCustom{non-local variable}{variable!non-local}
1459
- is a library variable, a class variable, or an instance variable.
1460
- \commentary{%
1461
- That is, any kind of variable which is not a local variable.%
1462
- }
1463
-
1464
1451
\LMHash{}%
1465
1452
A \IndexCustom{constant variable}{variable!constant}
1466
1453
is a variable whose declaration includes the modifier \CONST.
@@ -1496,15 +1483,12 @@ \section{Variables}
1496
1483
\subsection{Implicitly Induced Getters and Setters}
1497
1484
\LMLabel{implicitlyInducedGettersAndSetters}
1498
1485
1499
- %% TODO(eernst): When inference is specified, we should be able to conclude
1500
- %% that the cases with no declared type do not exist after type inference
1501
- %% (for instance `var x;` or `var x = e;`), and then we can replace all rules
1502
- %% about such cases by commentary saying that they may exist in the input,
1503
- %% but they are gone after type inference.
1504
- %%
1505
- %% At this time we rely on the assumption that type inference has already
1506
- %% occurred, which means that we can refer to the declared type of a variable
1507
- %% without mentioning type inference.
1486
+ %% TODO(eernst): We treat type inference as a step that has already
1487
+ %% taken place. We consider the types chosen by type inference to
1488
+ %% be available as a kind of semantic attributes of the syntax.
1489
+ %% That is, we can refer to the inferred type and say that the
1490
+ %% given declaration has the inferred type. In this way we avoid
1491
+ %% talking about an actual syntactic transformation.
1508
1492
1509
1493
\LMHash{}%
1510
1494
The following rules on implicitly induced getters and setters
@@ -1550,7 +1534,8 @@ \subsection{Implicitly Induced Getters and Setters}
1550
1534
1551
1535
\noindent
1552
1536
implicitly induces a getter with the header that
1553
- contains \STATIC{} if{}f the declaration contains \STATIC{} and is followed by
1537
+ contains \STATIC{} if{}f the declaration contains \STATIC,
1538
+ and is followed by
1554
1539
\code{$T$\,\,\GET\,\,\id},
1555
1540
where $T$ is obtained from type inference
1556
1541
in the case where $e$ exists,
@@ -1593,7 +1578,7 @@ \subsection{Implicitly Induced Getters and Setters}
1593
1578
\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)},
1594
1579
whose execution sets the value of \id{} to the incoming argument $x$.
1595
1580
The type $T$ is obtained from type inference
1596
- (\ref{overview }).
1581
+ (\ref{typeInference }).
1597
1582
\EndCase
1598
1583
1599
1584
\LMHash{}%
@@ -1606,10 +1591,10 @@ \subsection{Implicitly Induced Getters and Setters}
1606
1591
1607
1592
\commentary{%
1608
1593
Type inference has not yet been specified in this document
1609
- (\ref{overview }).
1610
- Note that type inference could change , e.g.,
1611
- \code{\VAR\,\,x;} to \code{ $T$\,\,x;} ,
1612
- which would take us to an earlier case .%
1594
+ (\ref{typeInference }).
1595
+ Note that type inference could provide , e.g.,
1596
+ \code{\VAR\,\,x;} with an inferred type $T$,
1597
+ which is then the declared type of the variable .%
1613
1598
}
1614
1599
\EndCase
1615
1600
@@ -1618,7 +1603,7 @@ \subsection{Implicitly Induced Getters and Setters}
1618
1603
A variable declaration of the form
1619
1604
\code{\STATIC?\,\,\LATE\,\,\FINAL\,\,$T$\,\,\id;}
1620
1605
implicitly induces a setter (\ref{setters}) with the header
1621
- \code{\VOID\,\,\SET\,\,\id(\DYNAMIC \,\,$x$)}.
1606
+ \code{\VOID\,\,\SET\,\,\id($T$ \,\,$x$)}.
1622
1607
If this setter is executed
1623
1608
in a situation where the variable \id{} has not been bound,
1624
1609
it will bind \id{} to the object that $x$ is bound to.
@@ -2017,9 +2002,6 @@ \subsection{Evaluation of Implicit Variable Getters}
2017
2002
% Reduce whitespace after itemized list: This is just an end symbol.
2018
2003
\vspace{-\baselineskip}\EndCase
2019
2004
2020
- % Reduce whitespace after itemized list: This is just an end symbol.
2021
- \vspace{-\baselineskip}\EndCase
2022
-
2023
2005
2024
2006
\section{Functions}
2025
2007
\LMLabel{functions}
@@ -5220,14 +5202,14 @@ \subsubsection{Inheritance and Overriding}
5220
5202
The controlling language is in the relevant sections of the specification.
5221
5203
5222
5204
\begin{enumerate}
5205
+
5223
5206
\item There is only one namespace
5224
5207
for getters, setters, methods and constructors (\ref{scoping}).
5225
- A non-local variable $f$ introduces a getter $f$,
5226
- and a non-local variable $f$
5227
- also introduces a setter
5208
+ A non-local variable $f$ introduces a getter $f$.
5209
+ A non-local variable $f$ also introduces a setter \code{$f$=}
5228
5210
if it is not final and not constant,
5229
5211
or it is late and final and has no initializing expression
5230
- \code{$f$=} (\ref{instanceVariables}, \ref{variables}).
5212
+ (\ref{instanceVariables}, \ref{variables}).
5231
5213
When we speak of members here, we mean
5232
5214
accessible instance, static, or library variables,
5233
5215
getters, setters, and methods
@@ -8822,7 +8804,7 @@ \subsection{Constants}
8822
8804
that is not qualified by a deferred prefix,
8823
8805
is a potentially constant and constant expression.
8824
8806
\commentary{%
8825
- For example, if class $C$ declares a constant class variable $v$,
8807
+ For example, if class $C$ declares a constant class variable $v$, !!!TODO!!!
8826
8808
\code{$C$.$v$} is a constant.
8827
8809
The same is true if $C$ is accessed via a prefix $p$;
8828
8810
\code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -12543,7 +12525,7 @@ \subsection{This}
12543
12525
12544
12526
\LMHash{}%
12545
12527
The static type of \THIS{} is the interface of the
12546
- immediately enclosing class, enum , or mixin , if any.
12528
+ immediately enclosing class, mixin , or enum , if any.
12547
12529
The static type of \THIS{} is
12548
12530
the \ON{} type of the enclosing extension, if any
12549
12531
(\ref{extensions}).
@@ -16625,7 +16607,7 @@ \subsection{Assignment}
16625
16607
16626
16608
\LMHash{}%
16627
16609
An assignment changes the value associated with a variable,
16628
- or invokes a setter.
16610
+ or it invokes a setter.
16629
16611
16630
16612
\begin{grammar}
16631
16613
<assignmentOperator> ::= `='
@@ -19117,7 +19099,8 @@ \subsection{Local Variable Declaration}
19117
19099
19118
19100
\LMHash{}%
19119
19101
The properties of being
19120
- \IndexCustom{initialized}{variable!initialized} or
19102
+ \IndexCustom{initialized}{variable!initialized},
19103
+ \IndexCustom{final}{variable!final}, or
19121
19104
\IndexCustom{constant}{variable!constant}
19122
19105
apply to local variables with the same definitions as for other variables
19123
19106
(\ref{variables}).
@@ -19209,7 +19192,7 @@ \subsection{Local Variable Declaration}
19209
19192
19210
19193
In every situation which is not covered by the previous paragraph,
19211
19194
it is a compile-time error to assign to a local variable
19212
- which is \FINAL{} and not \LATE{}
19195
+ which is final and not late
19213
19196
(\ref{assignment}).%
19214
19197
}
19215
19198
@@ -22478,10 +22461,13 @@ \subsection{Dynamic Type System}
22478
22461
}
22479
22462
22480
22463
\LMHash{}%
22481
- An expression is a \emph {type literal} if it is an identifier,
22464
+ An expression is a \Index {type literal} if it is an identifier,
22482
22465
or a qualified identifier,
22483
22466
which denotes a class, mixin, enum, or type alias declaration, or it is
22484
- an identifier denoting a type parameter of a generic class or function.
22467
+ an identifier denoting a type parameter of a generic class or function,
22468
+ or it is an identifier or qualified identifier which is a type literal
22469
+ and which is followed by a list of actual type arguments
22470
+ derived from \synt{typeArguments}.
22485
22471
It is a \emph{constant type literal} if it does not denote a type parameter,
22486
22472
and it is not qualified by a deferred prefix.
22487
22473
\commentary{%
0 commit comments