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,
@@ -788,7 +782,7 @@ \section{Notation}
788
782
Type inference of $e_j$ and the context type used for inference of $e_j$
789
783
are not relevant.
790
784
It is generally assumed that type inference has occurred already
791
- (\ref{overview }).%
785
+ (\ref{typeInference }).%
792
786
}
793
787
794
788
\LMHash{}%
@@ -1402,13 +1396,6 @@ \section{Variables}
1402
1396
That is, any kind of variable which is not a local variable.%
1403
1397
}
1404
1398
1405
- \LMHash{}%
1406
- A \IndexCustom{non-local variable}{variable!non-local}
1407
- is a library variable, a class variable, or an instance variable.
1408
- \commentary{%
1409
- That is, any kind of variable which is not a local variable.%
1410
- }
1411
-
1412
1399
\LMHash{}%
1413
1400
A \IndexCustom{constant variable}{variable!constant}
1414
1401
is a variable whose declaration includes the modifier \CONST.
@@ -1446,15 +1433,12 @@ \section{Variables}
1446
1433
\subsection{Implicitly Induced Getters and Setters}
1447
1434
\LMLabel{implicitlyInducedGettersAndSetters}
1448
1435
1449
- %% TODO(eernst): When inference is specified, we should be able to conclude
1450
- %% that the cases with no declared type do not exist after type inference
1451
- %% (for instance `var x;` or `var x = e;`), and then we can replace all rules
1452
- %% about such cases by commentary saying that they may exist in the input,
1453
- %% but they are gone after type inference.
1454
- %%
1455
- %% At this time we rely on the assumption that type inference has already
1456
- %% occurred, which means that we can refer to the declared type of a variable
1457
- %% without mentioning type inference.
1436
+ %% TODO(eernst): We treat type inference as a step that has already
1437
+ %% taken place. We consider the types chosen by type inference to
1438
+ %% be available as a kind of semantic attributes of the syntax.
1439
+ %% That is, we can refer to the inferred type and say that the
1440
+ %% given declaration has the inferred type. In this way we avoid
1441
+ %% talking about an actual syntactic transformation.
1458
1442
1459
1443
\LMHash{}%
1460
1444
The following rules on implicitly induced getters and setters
@@ -1500,7 +1484,8 @@ \subsection{Implicitly Induced Getters and Setters}
1500
1484
1501
1485
\noindent
1502
1486
implicitly induces a getter with the header that
1503
- contains \STATIC{} if{}f the declaration contains \STATIC{} and is followed by
1487
+ contains \STATIC{} if{}f the declaration contains \STATIC,
1488
+ and is followed by
1504
1489
\code{$T$\,\,\GET\,\,\id},
1505
1490
where $T$ is obtained from type inference
1506
1491
in the case where $e$ exists,
@@ -1543,7 +1528,7 @@ \subsection{Implicitly Induced Getters and Setters}
1543
1528
\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)},
1544
1529
whose execution sets the value of \id{} to the incoming argument $x$.
1545
1530
The type $T$ is obtained from type inference
1546
- (\ref{overview }).
1531
+ (\ref{typeInference }).
1547
1532
\EndCase
1548
1533
1549
1534
\LMHash{}%
@@ -1556,10 +1541,10 @@ \subsection{Implicitly Induced Getters and Setters}
1556
1541
1557
1542
\commentary{%
1558
1543
Type inference has not yet been specified in this document
1559
- (\ref{overview }).
1560
- Note that type inference could change , e.g.,
1561
- \code{\VAR\,\,x;} to \code{ $T$\,\,x;} ,
1562
- which would take us to an earlier case .%
1544
+ (\ref{typeInference }).
1545
+ Note that type inference could provide , e.g.,
1546
+ \code{\VAR\,\,x;} with an inferred type $T$,
1547
+ which is then the declared type of the variable .%
1563
1548
}
1564
1549
\EndCase
1565
1550
@@ -1568,7 +1553,7 @@ \subsection{Implicitly Induced Getters and Setters}
1568
1553
A variable declaration of the form
1569
1554
\code{\STATIC?\,\,\LATE\,\,\FINAL\,\,$T$\,\,\id;}
1570
1555
implicitly induces a setter (\ref{setters}) with the header
1571
- \code{\VOID\,\,\SET\,\,\id(\DYNAMIC \,\,$x$)}.
1556
+ \code{\VOID\,\,\SET\,\,\id($T$ \,\,$x$)}.
1572
1557
If this setter is executed
1573
1558
in a situation where the variable \id{} has not been bound,
1574
1559
it will bind \id{} to the object that $x$ is bound to.
@@ -1966,9 +1951,6 @@ \subsection{Evaluation of Implicit Variable Getters}
1966
1951
% Reduce whitespace after itemized list: This is just an end symbol.
1967
1952
\vspace{-\baselineskip}\EndCase
1968
1953
1969
- % Reduce whitespace after itemized list: This is just an end symbol.
1970
- \vspace{-\baselineskip}\EndCase
1971
-
1972
1954
1973
1955
\section{Functions}
1974
1956
\LMLabel{functions}
@@ -5124,12 +5106,11 @@ \subsubsection{Inheritance and Overriding}
5124
5106
5125
5107
\item There is only one namespace
5126
5108
for getters, setters, methods and constructors (\ref{scoping}).
5127
- A non-local variable $f$ introduces a getter $f$,
5128
- and a non-local variable $f$
5129
- also introduces a setter
5109
+ A non-local variable $f$ introduces a getter $f$.
5110
+ A non-local variable $f$ also introduces a setter \code{$f$=}
5130
5111
if it is not final and not constant,
5131
5112
or it is late and final and has no initializing expression
5132
- \code{$f$=} (\ref{instanceVariables}, \ref{variables}).
5113
+ (\ref{instanceVariables}, \ref{variables}).
5133
5114
When we speak of members here, we mean
5134
5115
accessible instance, static, or library variables,
5135
5116
getters, setters, and methods
@@ -8661,7 +8642,7 @@ \subsection{Constants}
8661
8642
that is not qualified by a deferred prefix,
8662
8643
is a potentially constant and constant expression.
8663
8644
\commentary{%
8664
- For example, if class $C$ declares a constant class variable $v$,
8645
+ For example, if class $C$ declares a constant class variable $v$, !!!TODO!!!
8665
8646
\code{$C$.$v$} is a constant.
8666
8647
The same is true if $C$ is accessed via a prefix $p$;
8667
8648
\code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -12288,7 +12269,7 @@ \subsection{This}
12288
12269
12289
12270
\LMHash{}%
12290
12271
The static type of \THIS{} is the interface of the
12291
- immediately enclosing class, enum , or mixin , if any.
12272
+ immediately enclosing class, mixin , or enum , if any.
12292
12273
The static type of \THIS{} is
12293
12274
the \ON{} type of the enclosing extension, if any
12294
12275
(\ref{extensions}).
@@ -16310,7 +16291,7 @@ \subsection{Assignment}
16310
16291
16311
16292
\LMHash{}%
16312
16293
An assignment changes the value associated with a variable,
16313
- or invokes a setter.
16294
+ or it invokes a setter.
16314
16295
16315
16296
\begin{grammar}
16316
16297
<assignmentOperator> ::= `='
@@ -18779,7 +18760,8 @@ \subsection{Local Variable Declaration}
18779
18760
18780
18761
\LMHash{}%
18781
18762
The properties of being
18782
- \IndexCustom{initialized}{variable!initialized} or
18763
+ \IndexCustom{initialized}{variable!initialized},
18764
+ \IndexCustom{final}{variable!final}, or
18783
18765
\IndexCustom{constant}{variable!constant}
18784
18766
apply to local variables with the same definitions as for other variables
18785
18767
(\ref{variables}).
@@ -18871,7 +18853,7 @@ \subsection{Local Variable Declaration}
18871
18853
18872
18854
In every situation which is not covered by the previous paragraph,
18873
18855
it is a compile-time error to assign to a local variable
18874
- which is \FINAL{} and not \LATE{}
18856
+ which is final and not late
18875
18857
(\ref{assignment}).%
18876
18858
}
18877
18859
@@ -22045,10 +22027,13 @@ \subsection{Dynamic Type System}
22045
22027
}
22046
22028
22047
22029
\LMHash{}%
22048
- An expression is a \emph {type literal} if it is an identifier,
22030
+ An expression is a \Index {type literal} if it is an identifier,
22049
22031
or a qualified identifier,
22050
22032
which denotes a class, mixin, enum, or type alias declaration, or it is
22051
- an identifier denoting a type parameter of a generic class or function.
22033
+ an identifier denoting a type parameter of a generic class or function,
22034
+ or it is an identifier or qualified identifier which is a type literal
22035
+ and which is followed by a list of actual type arguments
22036
+ derived from \synt{typeArguments}.
22052
22037
It is a \emph{constant type literal} if it does not denote a type parameter,
22053
22038
and it is not qualified by a deferred prefix.
22054
22039
\commentary{%
0 commit comments