Skip to content

Commit 9c91e5c

Browse files
committed
Post-rebase error correction
1 parent 0ddc130 commit 9c91e5c

File tree

1 file changed

+31
-45
lines changed

1 file changed

+31
-45
lines changed

specification/dartLangSpec.tex

Lines changed: 31 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,7 @@
2626
% CHANGES
2727
% =======
2828
%
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.
3630
%
3731
% Note that the version numbers used below (up to 2.15) were associated with
3832
% the currently released language and tools at the time of the spec change,
@@ -833,7 +827,7 @@ \section{Notation}
833827
Type inference of $e_j$ and the context type used for inference of $e_j$
834828
are not relevant.
835829
It is generally assumed that type inference has occurred already
836-
(\ref{overview}).%
830+
(\ref{typeInference}).%
837831
}
838832

839833
\LMHash{}%
@@ -1450,13 +1444,6 @@ \section{Variables}
14501444
That is, any kind of variable which is not a local variable.%
14511445
}
14521446

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-
14601447
\LMHash{}%
14611448
A \IndexCustom{constant variable}{variable!constant}
14621449
is a variable whose declaration includes the modifier \CONST.
@@ -1492,15 +1479,12 @@ \section{Variables}
14921479
\subsection{Implicitly Induced Getters and Setters}
14931480
\LMLabel{implicitlyInducedGettersAndSetters}
14941481

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.
15041488

15051489
\LMHash{}%
15061490
The following rules on implicitly induced getters and setters
@@ -1546,7 +1530,8 @@ \subsection{Implicitly Induced Getters and Setters}
15461530

15471531
\noindent
15481532
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
15501535
\code{$T$\,\,\GET\,\,\id},
15511536
where $T$ is obtained from type inference
15521537
in the case where $e$ exists,
@@ -1589,7 +1574,7 @@ \subsection{Implicitly Induced Getters and Setters}
15891574
\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)},
15901575
whose execution sets the value of \id{} to the incoming argument $x$.
15911576
The type $T$ is obtained from type inference
1592-
(\ref{overview}).
1577+
(\ref{typeInference}).
15931578
\EndCase
15941579

15951580
\LMHash{}%
@@ -1602,10 +1587,10 @@ \subsection{Implicitly Induced Getters and Setters}
16021587

16031588
\commentary{%
16041589
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.%
16091594
}
16101595
\EndCase
16111596

@@ -1614,7 +1599,7 @@ \subsection{Implicitly Induced Getters and Setters}
16141599
A variable declaration of the form
16151600
\code{\STATIC?\,\,\LATE\,\,\FINAL\,\,$T$\,\,\id;}
16161601
implicitly induces a setter (\ref{setters}) with the header
1617-
\code{\VOID\,\,\SET\,\,\id(\DYNAMIC\,\,$x$)}.
1602+
\code{\VOID\,\,\SET\,\,\id($T$\,\,$x$)}.
16181603
If this setter is executed
16191604
in a situation where the variable \id{} has not been bound,
16201605
it will bind \id{} to the object that $x$ is bound to.
@@ -2013,9 +1998,6 @@ \subsection{Evaluation of Implicit Variable Getters}
20131998
% Reduce whitespace after itemized list: This is just an end symbol.
20141999
\vspace{-\baselineskip}\EndCase
20152000

2016-
% Reduce whitespace after itemized list: This is just an end symbol.
2017-
\vspace{-\baselineskip}\EndCase
2018-
20192001

20202002
\section{Functions}
20212003
\LMLabel{functions}
@@ -5216,14 +5198,14 @@ \subsubsection{Inheritance and Overriding}
52165198
The controlling language is in the relevant sections of the specification.
52175199

52185200
\begin{enumerate}
5201+
52195202
\item There is only one namespace
52205203
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$=}
52245206
if it is not final and not constant,
52255207
or it is late and final and has no initializing expression
5226-
\code{$f$=} (\ref{instanceVariables}, \ref{variables}).
5208+
(\ref{instanceVariables}, \ref{variables}).
52275209
When we speak of members here, we mean
52285210
accessible instance, static, or library variables,
52295211
getters, setters, and methods
@@ -8818,7 +8800,7 @@ \subsection{Constants}
88188800
that is not qualified by a deferred prefix,
88198801
is a potentially constant and constant expression.
88208802
\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!!!
88228804
\code{$C$.$v$} is a constant.
88238805
The same is true if $C$ is accessed via a prefix $p$;
88248806
\code{$p$.$C$.$v$} is a constant unless $p$ is a deferred prefix.%
@@ -12539,7 +12521,7 @@ \subsection{This}
1253912521

1254012522
\LMHash{}%
1254112523
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.
1254312525
The static type of \THIS{} is
1254412526
the \ON{} type of the enclosing extension, if any
1254512527
(\ref{extensions}).
@@ -16621,7 +16603,7 @@ \subsection{Assignment}
1662116603

1662216604
\LMHash{}%
1662316605
An assignment changes the value associated with a variable,
16624-
or invokes a setter.
16606+
or it invokes a setter.
1662516607

1662616608
\begin{grammar}
1662716609
<assignmentOperator> ::= `='
@@ -19113,7 +19095,8 @@ \subsection{Local Variable Declaration}
1911319095

1911419096
\LMHash{}%
1911519097
The properties of being
19116-
\IndexCustom{initialized}{variable!initialized} or
19098+
\IndexCustom{initialized}{variable!initialized},
19099+
\IndexCustom{final}{variable!final}, or
1911719100
\IndexCustom{constant}{variable!constant}
1911819101
apply to local variables with the same definitions as for other variables
1911919102
(\ref{variables}).
@@ -19205,7 +19188,7 @@ \subsection{Local Variable Declaration}
1920519188

1920619189
In every situation which is not covered by the previous paragraph,
1920719190
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
1920919192
(\ref{assignment}).%
1921019193
}
1921119194

@@ -22474,10 +22457,13 @@ \subsection{Dynamic Type System}
2247422457
}
2247522458

2247622459
\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,
2247822461
or a qualified identifier,
2247922462
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}.
2248122467
It is a \emph{constant type literal} if it does not denote a type parameter,
2248222468
and it is not qualified by a deferred prefix.
2248322469
\commentary{%

0 commit comments

Comments
 (0)