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,
@@ -833,7 +827,7 @@ \section{Notation}
833
827
Type inference of $e_j$ and the context type used for inference of $e_j$
834
828
are not relevant.
835
829
It is generally assumed that type inference has occurred already
836
- (\ref{overview }).%
830
+ (\ref{typeInference }).%
837
831
}
838
832
839
833
\LMHash{}%
@@ -1450,13 +1444,6 @@ \section{Variables}
1450
1444
That is, any kind of variable which is not a local variable.%
1451
1445
}
1452
1446
1453
- \LMHash{}%
1454
- A \IndexCustom{non-local variable}{variable!non-local}
1455
- is a library variable, a class variable, or an instance variable.
1456
- \commentary{%
1457
- That is, any kind of variable which is not a local variable.%
1458
- }
1459
-
1460
1447
\LMHash{}%
1461
1448
A \IndexCustom{constant variable}{variable!constant}
1462
1449
is a variable whose declaration includes the modifier \CONST.
@@ -1492,15 +1479,12 @@ \section{Variables}
1492
1479
\subsection{Implicitly Induced Getters and Setters}
1493
1480
\LMLabel{implicitlyInducedGettersAndSetters}
1494
1481
1495
- %% TODO(eernst): When inference is specified, we should be able to conclude
1496
- %% that the cases with no declared type do not exist after type inference
1497
- %% (for instance `var x;` or `var x = e;`), and then we can replace all rules
1498
- %% about such cases by commentary saying that they may exist in the input,
1499
- %% but they are gone after type inference.
1500
- %%
1501
- %% At this time we rely on the assumption that type inference has already
1502
- %% occurred, which means that we can refer to the declared type of a variable
1503
- %% without mentioning type inference.
1482
+ %% TODO(eernst): We treat type inference as a step that has already
1483
+ %% taken place. We consider the types chosen by type inference to
1484
+ %% be available as a kind of semantic attributes of the syntax.
1485
+ %% That is, we can refer to the inferred type and say that the
1486
+ %% given declaration has the inferred type. In this way we avoid
1487
+ %% talking about an actual syntactic transformation.
1504
1488
1505
1489
\LMHash{}%
1506
1490
The following rules on implicitly induced getters and setters
@@ -1546,7 +1530,8 @@ \subsection{Implicitly Induced Getters and Setters}
1546
1530
1547
1531
\noindent
1548
1532
implicitly induces a getter with the header that
1549
- contains \STATIC{} if{}f the declaration contains \STATIC{} and is followed by
1533
+ contains \STATIC{} if{}f the declaration contains \STATIC,
1534
+ and is followed by
1550
1535
\code{$T$\,\,\GET\,\,\id},
1551
1536
where $T$ is obtained from type inference
1552
1537
in the case where $e$ exists,
@@ -1589,7 +1574,7 @@ \subsection{Implicitly Induced Getters and Setters}
1589
1574
\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)},
1590
1575
whose execution sets the value of \id{} to the incoming argument $x$.
1591
1576
The type $T$ is obtained from type inference
1592
- (\ref{overview }).
1577
+ (\ref{typeInference }).
1593
1578
\EndCase
1594
1579
1595
1580
\LMHash{}%
@@ -1602,10 +1587,10 @@ \subsection{Implicitly Induced Getters and Setters}
1602
1587
1603
1588
\commentary{%
1604
1589
Type inference has not yet been specified in this document
1605
- (\ref{overview }).
1606
- Note that type inference could change , e.g.,
1607
- \code{\VAR\,\,x;} to \code{ $T$\,\,x;} ,
1608
- which would take us to an earlier case .%
1590
+ (\ref{typeInference }).
1591
+ Note that type inference could provide , e.g.,
1592
+ \code{\VAR\,\,x;} with an inferred type $T$,
1593
+ which is then the declared type of the variable .%
1609
1594
}
1610
1595
\EndCase
1611
1596
@@ -1614,7 +1599,7 @@ \subsection{Implicitly Induced Getters and Setters}
1614
1599
A variable declaration of the form
1615
1600
\code{\STATIC?\,\,\LATE\,\,\FINAL\,\,$T$\,\,\id;}
1616
1601
implicitly induces a setter (\ref{setters}) with the header
1617
- \code{\VOID\,\,\SET\,\,\id(\DYNAMIC \,\,$x$)}.
1602
+ \code{\VOID\,\,\SET\,\,\id($T$ \,\,$x$)}.
1618
1603
If this setter is executed
1619
1604
in a situation where the variable \id{} has not been bound,
1620
1605
it will bind \id{} to the object that $x$ is bound to.
@@ -2013,9 +1998,6 @@ \subsection{Evaluation of Implicit Variable Getters}
2013
1998
% Reduce whitespace after itemized list: This is just an end symbol.
2014
1999
\vspace{-\baselineskip}\EndCase
2015
2000
2016
- % Reduce whitespace after itemized list: This is just an end symbol.
2017
- \vspace{-\baselineskip}\EndCase
2018
-
2019
2001
2020
2002
\section{Functions}
2021
2003
\LMLabel{functions}
@@ -5216,14 +5198,14 @@ \subsubsection{Inheritance and Overriding}
5216
5198
The controlling language is in the relevant sections of the specification.
5217
5199
5218
5200
\begin{enumerate}
5201
+
5219
5202
\item There is only one namespace
5220
5203
for getters, setters, methods and constructors (\ref{scoping}).
5221
- A non-local variable $f$ introduces a getter $f$,
5222
- and a non-local variable $f$
5223
- also introduces a setter
5204
+ A non-local variable $f$ introduces a getter $f$.
5205
+ A non-local variable $f$ also introduces a setter \code{$f$=}
5224
5206
if it is not final and not constant,
5225
5207
or it is late and final and has no initializing expression
5226
- \code{$f$=} (\ref{instanceVariables}, \ref{variables}).
5208
+ (\ref{instanceVariables}, \ref{variables}).
5227
5209
When we speak of members here, we mean
5228
5210
accessible instance, static, or library variables,
5229
5211
getters, setters, and methods
@@ -8818,7 +8800,7 @@ \subsection{Constants}
8818
8800
that is not qualified by a deferred prefix,
8819
8801
is a potentially constant and constant expression.
8820
8802
\commentary{%
8821
- For example, if class $C$ declares a constant class variable $v$,
8803
+ For example, if class $C$ declares a constant class variable $v$, !!!TODO!!!
8822
8804
\code{$C$.$v$} is a constant.
8823
8805
The same is true if $C$ is accessed via a prefix $p$;
8824
8806
\code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -12539,7 +12521,7 @@ \subsection{This}
12539
12521
12540
12522
\LMHash{}%
12541
12523
The static type of \THIS{} is the interface of the
12542
- immediately enclosing class, enum , or mixin , if any.
12524
+ immediately enclosing class, mixin , or enum , if any.
12543
12525
The static type of \THIS{} is
12544
12526
the \ON{} type of the enclosing extension, if any
12545
12527
(\ref{extensions}).
@@ -16621,7 +16603,7 @@ \subsection{Assignment}
16621
16603
16622
16604
\LMHash{}%
16623
16605
An assignment changes the value associated with a variable,
16624
- or invokes a setter.
16606
+ or it invokes a setter.
16625
16607
16626
16608
\begin{grammar}
16627
16609
<assignmentOperator> ::= `='
@@ -19113,7 +19095,8 @@ \subsection{Local Variable Declaration}
19113
19095
19114
19096
\LMHash{}%
19115
19097
The properties of being
19116
- \IndexCustom{initialized}{variable!initialized} or
19098
+ \IndexCustom{initialized}{variable!initialized},
19099
+ \IndexCustom{final}{variable!final}, or
19117
19100
\IndexCustom{constant}{variable!constant}
19118
19101
apply to local variables with the same definitions as for other variables
19119
19102
(\ref{variables}).
@@ -19205,7 +19188,7 @@ \subsection{Local Variable Declaration}
19205
19188
19206
19189
In every situation which is not covered by the previous paragraph,
19207
19190
it is a compile-time error to assign to a local variable
19208
- which is \FINAL{} and not \LATE{}
19191
+ which is final and not late
19209
19192
(\ref{assignment}).%
19210
19193
}
19211
19194
@@ -22474,10 +22457,13 @@ \subsection{Dynamic Type System}
22474
22457
}
22475
22458
22476
22459
\LMHash{}%
22477
- An expression is a \emph {type literal} if it is an identifier,
22460
+ An expression is a \Index {type literal} if it is an identifier,
22478
22461
or a qualified identifier,
22479
22462
which denotes a class, mixin, enum, or type alias declaration, or it is
22480
- an identifier denoting a type parameter of a generic class or function.
22463
+ an identifier denoting a type parameter of a generic class or function,
22464
+ or it is an identifier or qualified identifier which is a type literal
22465
+ and which is followed by a list of actual type arguments
22466
+ derived from \synt{typeArguments}.
22481
22467
It is a \emph{constant type literal} if it does not denote a type parameter,
22482
22468
and it is not qualified by a deferred prefix.
22483
22469
\commentary{%
0 commit comments