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,
@@ -783,7 +777,7 @@ \section{Notation}
783
777
Type inference of $e_j$ and the context type used for inference of $e_j$
784
778
are not relevant.
785
779
It is generally assumed that type inference has occurred already
786
- (\ref{overview }).%
780
+ (\ref{typeInference }).%
787
781
}
788
782
789
783
\LMHash{}%
@@ -1397,13 +1391,6 @@ \section{Variables}
1397
1391
That is, any kind of variable which is not a local variable.%
1398
1392
}
1399
1393
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
-
1407
1394
\LMHash{}%
1408
1395
A \IndexCustom{constant variable}{variable!constant}
1409
1396
is a variable whose declaration includes the modifier \CONST.
@@ -1441,15 +1428,12 @@ \section{Variables}
1441
1428
\subsection{Implicitly Induced Getters and Setters}
1442
1429
\LMLabel{implicitlyInducedGettersAndSetters}
1443
1430
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.
1453
1437
1454
1438
\LMHash{}%
1455
1439
The following rules on implicitly induced getters and setters
@@ -1495,7 +1479,8 @@ \subsection{Implicitly Induced Getters and Setters}
1495
1479
1496
1480
\noindent
1497
1481
implicitly 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
1499
1484
\code{$T$\,\,\GET\,\,\id},
1500
1485
where $T$ is obtained from type inference
1501
1486
in the case where $e$ exists,
@@ -1538,7 +1523,7 @@ \subsection{Implicitly Induced Getters and Setters}
1538
1523
\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)},
1539
1524
whose execution sets the value of \id{} to the incoming argument $x$.
1540
1525
The type $T$ is obtained from type inference
1541
- (\ref{overview }).
1526
+ (\ref{typeInference }).
1542
1527
\EndCase
1543
1528
1544
1529
\LMHash{}%
@@ -1551,10 +1536,10 @@ \subsection{Implicitly Induced Getters and Setters}
1551
1536
1552
1537
\commentary{%
1553
1538
Type 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 .%
1558
1543
}
1559
1544
\EndCase
1560
1545
@@ -1563,7 +1548,7 @@ \subsection{Implicitly Induced Getters and Setters}
1563
1548
A variable declaration of the form
1564
1549
\code{\STATIC?\,\,\LATE\,\,\FINAL\,\,$T$\,\,\id;}
1565
1550
implicitly induces a setter (\ref{setters}) with the header
1566
- \code{\VOID\,\,\SET\,\,\id(\DYNAMIC \,\,$x$)}.
1551
+ \code{\VOID\,\,\SET\,\,\id($T$ \,\,$x$)}.
1567
1552
If this setter is executed
1568
1553
in a situation where the variable \id{} has not been bound,
1569
1554
it will bind \id{} to the object that $x$ is bound to.
@@ -1961,9 +1946,6 @@ \subsection{Evaluation of Implicit Variable Getters}
1961
1946
% Reduce whitespace after itemized list: This is just an end symbol.
1962
1947
\vspace{-\baselineskip}\EndCase
1963
1948
1964
- % Reduce whitespace after itemized list: This is just an end symbol.
1965
- \vspace{-\baselineskip}\EndCase
1966
-
1967
1949
1968
1950
\section{Functions}
1969
1951
\LMLabel{functions}
@@ -5119,12 +5101,11 @@ \subsubsection{Inheritance and Overriding}
5119
5101
5120
5102
\item There is only one namespace
5121
5103
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$=}
5125
5106
if it is not final and not constant,
5126
5107
or it is late and final and has no initializing expression
5127
- \code{$f$=} (\ref{instanceVariables}, \ref{variables}).
5108
+ (\ref{instanceVariables}, \ref{variables}).
5128
5109
When we speak of members here, we mean
5129
5110
accessible instance, static, or library variables,
5130
5111
getters, setters, and methods
@@ -8656,7 +8637,7 @@ \subsection{Constants}
8656
8637
that is not qualified by a deferred prefix,
8657
8638
is a potentially constant and constant expression.
8658
8639
\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!!!
8660
8641
\code{$C$.$v$} is a constant.
8661
8642
The same is true if $C$ is accessed via a prefix $p$;
8662
8643
\code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -12283,7 +12264,7 @@ \subsection{This}
12283
12264
12284
12265
\LMHash{}%
12285
12266
The 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.
12287
12268
The static type of \THIS{} is
12288
12269
the \ON{} type of the enclosing extension, if any
12289
12270
(\ref{extensions}).
@@ -16305,7 +16286,7 @@ \subsection{Assignment}
16305
16286
16306
16287
\LMHash{}%
16307
16288
An assignment changes the value associated with a variable,
16308
- or invokes a setter.
16289
+ or it invokes a setter.
16309
16290
16310
16291
\begin{grammar}
16311
16292
<assignmentOperator> ::= `='
@@ -18770,7 +18751,8 @@ \subsection{Local Variable Declaration}
18770
18751
18771
18752
\LMHash{}%
18772
18753
The properties of being
18773
- \IndexCustom{initialized}{variable!initialized} or
18754
+ \IndexCustom{initialized}{variable!initialized},
18755
+ \IndexCustom{final}{variable!final}, or
18774
18756
\IndexCustom{constant}{variable!constant}
18775
18757
apply to local variables with the same definitions as for other variables
18776
18758
(\ref{variables}).
@@ -18862,7 +18844,7 @@ \subsection{Local Variable Declaration}
18862
18844
18863
18845
In every situation which is not covered by the previous paragraph,
18864
18846
it 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
18866
18848
(\ref{assignment}).%
18867
18849
}
18868
18850
@@ -22034,10 +22016,13 @@ \subsection{Dynamic Type System}
22034
22016
}
22035
22017
22036
22018
\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,
22038
22020
or a qualified identifier,
22039
22021
which 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}.
22041
22026
It is a \emph{constant type literal} if it does not denote a type parameter,
22042
22027
and it is not qualified by a deferred prefix.
22043
22028
\commentary{%
0 commit comments