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,
@@ -778,7 +772,7 @@ \section{Notation}
778
772
Type inference of $e_j$ and the context type used for inference of $e_j$
779
773
are not relevant.
780
774
It is generally assumed that type inference has occurred already
781
- (\ref{overview }).%
775
+ (\ref{typeInference }).%
782
776
}
783
777
784
778
\LMHash{}%
@@ -1392,13 +1386,6 @@ \section{Variables}
1392
1386
That is, any kind of variable which is not a local variable.%
1393
1387
}
1394
1388
1395
- \LMHash{}%
1396
- A \IndexCustom{non-local variable}{variable!non-local}
1397
- is a library variable, a class variable, or an instance variable.
1398
- \commentary{%
1399
- That is, any kind of variable which is not a local variable.%
1400
- }
1401
-
1402
1389
\LMHash{}%
1403
1390
A \IndexCustom{constant variable}{variable!constant}
1404
1391
is a variable whose declaration includes the modifier \CONST.
@@ -1436,15 +1423,12 @@ \section{Variables}
1436
1423
\subsection{Implicitly Induced Getters and Setters}
1437
1424
\LMLabel{implicitlyInducedGettersAndSetters}
1438
1425
1439
- %% TODO(eernst): When inference is specified, we should be able to conclude
1440
- %% that the cases with no declared type do not exist after type inference
1441
- %% (for instance `var x;` or `var x = e;`), and then we can replace all rules
1442
- %% about such cases by commentary saying that they may exist in the input,
1443
- %% but they are gone after type inference.
1444
- %%
1445
- %% At this time we rely on the assumption that type inference has already
1446
- %% occurred, which means that we can refer to the declared type of a variable
1447
- %% without mentioning type inference.
1426
+ %% TODO(eernst): We treat type inference as a step that has already
1427
+ %% taken place. We consider the types chosen by type inference to
1428
+ %% be available as a kind of semantic attributes of the syntax.
1429
+ %% That is, we can refer to the inferred type and say that the
1430
+ %% given declaration has the inferred type. In this way we avoid
1431
+ %% talking about an actual syntactic transformation.
1448
1432
1449
1433
\LMHash{}%
1450
1434
The following rules on implicitly induced getters and setters
@@ -1490,7 +1474,8 @@ \subsection{Implicitly Induced Getters and Setters}
1490
1474
1491
1475
\noindent
1492
1476
implicitly induces a getter with the header that
1493
- contains \STATIC{} if{}f the declaration contains \STATIC{} and is followed by
1477
+ contains \STATIC{} if{}f the declaration contains \STATIC,
1478
+ and is followed by
1494
1479
\code{$T$\,\,\GET\,\,\id},
1495
1480
where $T$ is obtained from type inference
1496
1481
in the case where $e$ exists,
@@ -1533,7 +1518,7 @@ \subsection{Implicitly Induced Getters and Setters}
1533
1518
\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)},
1534
1519
whose execution sets the value of \id{} to the incoming argument $x$.
1535
1520
The type $T$ is obtained from type inference
1536
- (\ref{overview }).
1521
+ (\ref{typeInference }).
1537
1522
\EndCase
1538
1523
1539
1524
\LMHash{}%
@@ -1546,10 +1531,10 @@ \subsection{Implicitly Induced Getters and Setters}
1546
1531
1547
1532
\commentary{%
1548
1533
Type inference has not yet been specified in this document
1549
- (\ref{overview }).
1550
- Note that type inference could change , e.g.,
1551
- \code{\VAR\,\,x;} to \code{ $T$\,\,x;} ,
1552
- which would take us to an earlier case .%
1534
+ (\ref{typeInference }).
1535
+ Note that type inference could provide , e.g.,
1536
+ \code{\VAR\,\,x;} with an inferred type $T$,
1537
+ which is then the declared type of the variable .%
1553
1538
}
1554
1539
\EndCase
1555
1540
@@ -1558,7 +1543,7 @@ \subsection{Implicitly Induced Getters and Setters}
1558
1543
A variable declaration of the form
1559
1544
\code{\STATIC?\,\,\LATE\,\,\FINAL\,\,$T$\,\,\id;}
1560
1545
implicitly induces a setter (\ref{setters}) with the header
1561
- \code{\VOID\,\,\SET\,\,\id(\DYNAMIC \,\,$x$)}.
1546
+ \code{\VOID\,\,\SET\,\,\id($T$ \,\,$x$)}.
1562
1547
If this setter is executed
1563
1548
in a situation where the variable \id{} has not been bound,
1564
1549
it will bind \id{} to the object that $x$ is bound to.
@@ -1956,9 +1941,6 @@ \subsection{Evaluation of Implicit Variable Getters}
1956
1941
% Reduce whitespace after itemized list: This is just an end symbol.
1957
1942
\vspace{-\baselineskip}\EndCase
1958
1943
1959
- % Reduce whitespace after itemized list: This is just an end symbol.
1960
- \vspace{-\baselineskip}\EndCase
1961
-
1962
1944
1963
1945
\section{Functions}
1964
1946
\LMLabel{functions}
@@ -5104,12 +5086,11 @@ \subsubsection{Inheritance and Overriding}
5104
5086
5105
5087
\item There is only one namespace
5106
5088
for getters, setters, methods and constructors (\ref{scoping}).
5107
- A non-local variable $f$ introduces a getter $f$,
5108
- and a non-local variable $f$
5109
- also introduces a setter
5089
+ A non-local variable $f$ introduces a getter $f$.
5090
+ A non-local variable $f$ also introduces a setter \code{$f$=}
5110
5091
if it is not final and not constant,
5111
5092
or it is late and final and has no initializing expression
5112
- \code{$f$=} (\ref{instanceVariables}, \ref{variables}).
5093
+ (\ref{instanceVariables}, \ref{variables}).
5113
5094
When we speak of members here, we mean
5114
5095
accessible instance, static, or library variables,
5115
5096
getters, setters, and methods
@@ -8643,7 +8624,7 @@ \subsection{Constants}
8643
8624
that is not qualified by a deferred prefix,
8644
8625
is a potentially constant and constant expression.
8645
8626
\commentary{%
8646
- For example, if class $C$ declares a constant class variable $v$,
8627
+ For example, if class $C$ declares a constant class variable $v$, !!!TODO!!!
8647
8628
\code{$C$.$v$} is a constant.
8648
8629
The same is true if $C$ is accessed via a prefix $p$;
8649
8630
\code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -12270,7 +12251,7 @@ \subsection{This}
12270
12251
12271
12252
\LMHash{}%
12272
12253
The static type of \THIS{} is the interface of the
12273
- immediately enclosing class, enum , or mixin , if any.
12254
+ immediately enclosing class, mixin , or enum , if any.
12274
12255
The static type of \THIS{} is
12275
12256
the \ON{} type of the enclosing extension, if any
12276
12257
(\ref{extensions}).
@@ -16291,7 +16272,7 @@ \subsection{Assignment}
16291
16272
16292
16273
\LMHash{}%
16293
16274
An assignment changes the value associated with a variable,
16294
- or invokes a setter.
16275
+ or it invokes a setter.
16295
16276
16296
16277
\begin{grammar}
16297
16278
<assignmentOperator> ::= `='
@@ -18756,7 +18737,8 @@ \subsection{Local Variable Declaration}
18756
18737
18757
18738
\LMHash{}%
18758
18739
The properties of being
18759
- \IndexCustom{initialized}{variable!initialized} or
18740
+ \IndexCustom{initialized}{variable!initialized},
18741
+ \IndexCustom{final}{variable!final}, or
18760
18742
\IndexCustom{constant}{variable!constant}
18761
18743
apply to local variables with the same definitions as for other variables
18762
18744
(\ref{variables}).
@@ -18848,7 +18830,7 @@ \subsection{Local Variable Declaration}
18848
18830
18849
18831
In every situation which is not covered by the previous paragraph,
18850
18832
it is a compile-time error to assign to a local variable
18851
- which is \FINAL{} and not \LATE{}
18833
+ which is final and not late
18852
18834
(\ref{assignment}).%
18853
18835
}
18854
18836
@@ -22025,10 +22007,13 @@ \subsection{Dynamic Type System}
22025
22007
}
22026
22008
22027
22009
\LMHash{}%
22028
- An expression is a \emph {type literal} if it is an identifier,
22010
+ An expression is a \Index {type literal} if it is an identifier,
22029
22011
or a qualified identifier,
22030
22012
which denotes a class, mixin, enum, or type alias declaration, or it is
22031
- an identifier denoting a type parameter of a generic class or function.
22013
+ an identifier denoting a type parameter of a generic class or function,
22014
+ or it is an identifier or qualified identifier which is a type literal
22015
+ and which is followed by a list of actual type arguments
22016
+ derived from \synt{typeArguments}.
22032
22017
It is a \emph{constant type literal} if it does not denote a type parameter,
22033
22018
and it is not qualified by a deferred prefix.
22034
22019
\commentary{%
0 commit comments