Skip to content

Commit a5bf7ad

Browse files
committed
Rebase
1 parent 3d3c42d commit a5bf7ad

File tree

1 file changed

+110
-70
lines changed

1 file changed

+110
-70
lines changed

specification/dartLangSpec.tex

Lines changed: 110 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -13978,7 +13978,7 @@ \subsection{Lookup}
1397813978

1397913979
{ % Scope for `lookup' definition.
1398013980

13981-
\def\LookupDefinitionWithStart#1{
13981+
\def\LookupDefinitionWithStart#1{%
1398213982
\LMHash{}%
1398313983
The result of a
1398413984
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14301,7 +14301,7 @@ \subsection{Member Invocations}
1430114301
expression $r$ is an expression of
1430214302
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
1430314303
Each member invocation has a
14304-
\IndexCustom{corresponding member name}{
14304+
\IndexCustom{corresponding member name}{%
1430514305
member invocation!corresponding member name}
1430614306
as shown in the figure.
1430714307

@@ -16001,7 +16001,7 @@ \subsection{Null Shorting}
1600116001
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
1600216002
is defined as follows:
1600316003

16004-
{
16004+
{%
1600516005
\def\Base#1{\textcolor{normativeColor}{#1}}
1600616006
\def\Meta#1{\textcolor{metaColor}{#1}}
1600716007
\begin{metaLevelCode}
@@ -22427,29 +22427,27 @@ \subsection{Subtypes}
2242722427
\newcommand{\SrnRightTop}{2}
2242822428
\newcommand{\SrnLeftTop}{3}
2242922429
\newcommand{\SrnBottom}{4}
22430-
\newcommand{\SrnRightObjectOne}{5.1}
22431-
\newcommand{\SrnRightObjectTwo}{5.2}
22432-
\newcommand{\SrnRightObjectThree}{5.3}
22433-
\newcommand{\SrnRightObjectFour}{5.4}
22434-
\newcommand{\SrnNullOne}{6.1}
22435-
\newcommand{\SrnNullTwo}{6.2}
22436-
\newcommand{\SrnLeftFutureOr}{7}
22437-
\newcommand{\SrnLeftNullable}{7b}
22438-
\newcommand{\SrnTypeVariableReflexivityA}{8}
22439-
\newcommand{\SrnRightPromotedVariable}{9}
22440-
\newcommand{\SrnRightFutureOrA}{10}
22441-
\newcommand{\SrnRightFutureOrB}{11}
22442-
\newcommand{\SrnRightNullableOne}{11b.1}
22443-
\newcommand{\SrnRightNullableTwo}{11b.2}
22444-
\newcommand{\SrnRightNullableThree}{11b.3}
22445-
\newcommand{\SrnRightNullableFour}{11b.4}
22446-
\newcommand{\SrnLeftPromotedVariable}{12}
22447-
\newcommand{\SrnLeftVariableBound}{13}
22448-
\newcommand{\SrnRightFunction}{14}
22449-
\newcommand{\SrnPositionalFunctionType}{15}
22450-
\newcommand{\SrnNamedFunctionType}{16}
22451-
\newcommand{\SrnCovariance}{17}
22452-
\newcommand{\SrnSuperinterface}{18}
22430+
%\newcommand{\SrnRightObjectOne}{}
22431+
%\newcommand{\SrnRightObjectTwo}{}
22432+
%\newcommand{\SrnRightObjectThree}{}
22433+
\newcommand{\SrnRightObjectFour}{5}
22434+
\newcommand{\SrnNullOne}{6}
22435+
\newcommand{\SrnNullTwo}{7}
22436+
\newcommand{\SrnLeftFutureOr}{8}
22437+
\newcommand{\SrnLeftNullable}{9}
22438+
\newcommand{\SrnTypeVariableReflexivityA}{10}
22439+
\newcommand{\SrnRightPromotedVariable}{11}
22440+
\newcommand{\SrnRightFutureOrA}{12}
22441+
\newcommand{\SrnRightFutureOrB}{13}
22442+
\newcommand{\SrnRightNullableOne}{14}
22443+
\newcommand{\SrnRightNullableTwo}{15}
22444+
\newcommand{\SrnLeftPromotedVariable}{16}
22445+
\newcommand{\SrnLeftVariableBound}{17}
22446+
\newcommand{\SrnRightFunction}{18}
22447+
\newcommand{\SrnPositionalFunctionType}{19}
22448+
\newcommand{\SrnNamedFunctionType}{20}
22449+
\newcommand{\SrnCovariance}{21}
22450+
\newcommand{\SrnSuperinterface}{22}
2245322451

2245422452
\begin{figure}[p]
2245522453
\def\VSP{\vspace{4mm}}
@@ -22462,56 +22460,96 @@ \subsection{Subtypes}
2246222460
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
2246322461
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
2246422462
%
22463+
% ----------------------------------------------------------------------
22464+
% Omitted rules stated here, with justification for
22465+
% the omission.
22466+
% ------------------------------------------------ Right Object 1
22467+
% Not needed unless algorithmic: Instance of
22468+
% \SrnLeftVariableBound.
22469+
% \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22470+
% \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22471+
% }{X}{\code{Object}}
22472+
% ------------------------------------------------ Right Object 2
22473+
% Not needed unless algorithmic: Instance of
22474+
% \SrnLeftPromotedVariable.
22475+
% \RuleRaw{\SrnRightObjectTwo}{}{%
22476+
% \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22477+
% ------------------------------------------------ Right Object 3
22478+
% Not needed unless algorithmic: Derivable from
22479+
% \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22480+
% Future<S> <: Object).
22481+
% \RuleRaw{\SrnRightObjectThree}{}{%
22482+
% \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22483+
% ----------------------------------------------------------------------
2246522484
\begin{minipage}[c]{0.49\textwidth}
22466-
\Axiom{\SrnReflexivity}{Reflexivity}{T}{T}
22467-
\Axiom{\SrnBottom}{Left Bottom}{\code{Never}}{T}
22468-
\RuleRaw{\SrnRightObjectTwo}{Right Object 2}{%
22469-
\SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22470-
\RuleRaw{\SrnRightObjectThree}{Right Object 3}{%
22471-
\SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22472-
\Axiom{\SrnNullOne}{Left Null One}{\code{Null}}{\code{$T$?}}
22485+
% ------------------------------------------------ Reflexivity
22486+
\Axiom{\SrnReflexivity}{}{T}{T}
22487+
\ExtraVSP
22488+
% ------------------------------------------------ Left Top
22489+
% Non-algorithmic justification for this rule: Needed
22490+
% to prove dynamic/void <: FutureOr<Object>?.
22491+
\RuleRaw{\SrnLeftTop}{}{%
22492+
S \in \{\DYNAMIC, \VOID\}\\
22493+
\SubtypeStd{\code{Object?}}{T}}{S}{T}
22494+
% ------------------------------------------------ Left Bottom
22495+
\Axiom{\SrnBottom}{}{\code{Never}}{T}
22496+
% ------------------------------------------------ Left Null 1
22497+
\Axiom{\SrnNullOne}{}{\code{Null}}{\code{$T$?}}
2247322498
\end{minipage}
2247422499
\begin{minipage}[c]{0.49\textwidth}
22475-
\RuleRaw{\SrnRightTop}{Right Top}{%
22500+
% ------------------------------------------------ Right Top
22501+
\RuleRaw{\SrnRightTop}{}{%
2247622502
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22477-
\RuleRaw{\SrnLeftTop}{Left Top}{%
22478-
S \in \{\DYNAMIC, \VOID\} & \SubtypeStd{\code{Object?}}{T}}{S}{T}
22479-
\RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22480-
\code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22481-
}{X}{\code{Object}}
22482-
\RuleRaw{\SrnRightObjectFour}{Right Object 4}{%
22503+
% ------------------------------------------------ Right Object 4
22504+
\RuleRaw{\SrnRightObjectFour}{}{%
2248322505
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22484-
\mbox{$S$ is not of the form \code{$U$?}, $X$, %
22485-
\code{$X$\,\&\,$U$}, \code{FutureOr<$U$>}}}{S}{\code{Object}}
22486-
\Rule{\SrnNullTwo}{Left Null Two}{\code{Null}}{T}{%
22506+
\mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22507+
\mbox{\code{$X$\,\&\,$U$}, %
22508+
or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22509+
% ------------------------------------------------ Left Null 2
22510+
\Rule{\SrnNullTwo}{}{\code{Null}}{T}{%
2248722511
\code{Null}}{\code{FutureOr<$T$>}}
2248822512
\end{minipage}
2248922513

2249022514
\begin{minipage}[c]{0.49\textwidth}
22491-
\RuleTwo{\SrnLeftFutureOr}{Left FutureOr}{S}{T}{%
22492-
\code{Future<$S$>}}{T}{\code{FutureOr<$S$>}}{T}
22493-
\RuleTwo{\SrnRightPromotedVariable}{Right Promoted Variable}{S}{X}{S}{T}{%
22515+
% ------------------------------------------------ Left FutureOr
22516+
\RuleTwo{\SrnLeftFutureOr}{}{%
22517+
\code{Future<$S$>}}{T}{S}{T}{%
22518+
\code{FutureOr<$S$>}}{T}
22519+
% ------------------------------------------------ Right Promoted Variable
22520+
\RuleTwo{\SrnRightPromotedVariable}{}{S}{X}{S}{T}{%
2249422521
S}{X \& T}
22495-
\Rule{\SrnRightFutureOrB}{Right FutureOr B}{S}{T}{S}{\code{FutureOr<$T$>}}
22496-
\Rule{\SrnRightNullableTwo}{Right Nullable 2}{S}{\code{Null}}{S}{%
22522+
% ------------------------------------------------ Right FutureOr B
22523+
\Rule{\SrnRightFutureOrB}{}{S}{T}{S}{%
22524+
\code{FutureOr<$T$>}}
22525+
% ------------------------------------------------ Right Nullable 2
22526+
\Rule{\SrnRightNullableTwo}{}{S}{\code{Null}}{S}{%
2249722527
\code{$T$?}}
22498-
\Rule{\SrnLeftVariableBound}{Left Variable Bound}{\Delta(X)}{T}{X}{T}
22528+
% ------------------------------------------------ Left Variable Bound
22529+
\Rule{\SrnLeftVariableBound}{}{\Delta(X)}{T}{X}{T}
2249922530
\end{minipage}
2250022531
\begin{minipage}[c]{0.49\textwidth}
22501-
\RuleTwo{\SrnLeftNullable}{Left Nullable}{S}{T}{\code{Null}}{T}{
22532+
% ------------------------------------------------ Left Nullable
22533+
\RuleTwo{\SrnLeftNullable}{}{S}{T}{\code{Null}}{T}{%
2250222534
\code{$S$?}}{T}
22503-
\Axiom{\SrnTypeVariableReflexivityA}{Left Promoted Variable A}{X \& S}{X}
22504-
\Rule{\SrnRightFutureOrA}{Right FutureOr A}{S}{\code{Future<$T$>}}{%
22505-
S}{\code{FutureOr<$T$>}}
22506-
\Rule{\SrnRightNullableOne}{Right Nullable 1}{S}{T}{S}{\code{$T$?}}
22507-
\Rule{\SrnLeftPromotedVariable}{Left Promoted Variable B}{S}{T}{X \& S}{T}
22508-
\RuleRaw{\SrnRightFunction}{Right Function}{T\mbox{ is a function type}}{%
22509-
T}{\FUNCTION}
22535+
% ------------------------------------------------ Left Promoted Variable A
22536+
\Axiom{\SrnTypeVariableReflexivityA}{}{X \& S}{X}
22537+
% ------------------------------------------------ Right FutureOr A
22538+
\Rule{\SrnRightFutureOrA}{}{S}{%
22539+
\code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22540+
% ------------------------------------------------ Right Nullable 1
22541+
\Rule{\SrnRightNullableOne}{}{S}{T}{S}{\code{$T$?}}
22542+
% ------------------------------------------------ Left Promoted Variable B
22543+
\Rule{\SrnLeftPromotedVariable}{}{S}{T}{X \& S}{T}
22544+
% ------------------------------------------------ Right Function
22545+
\RuleRaw{\SrnRightFunction}{}{%
22546+
T\mbox{ is a function type}}{T}{\FUNCTION}
2251022547
\end{minipage}
2251122548
%
2251222549
\ExtraVSP
22513-
\RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22514-
\Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22550+
% ------------------------------------------------ Positional Function Type
22551+
\RuleRawRaw{\SrnPositionalFunctionType}{}{%
22552+
\Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2251522553
\Subtype{\Delta'}{S_0}{T_0} \\
2251622554
n_1 \leq n_2 &
2251722555
n_1 + k_1 \geq n_2 + k_2 &
@@ -22521,10 +22559,11 @@ \subsection{Subtypes}
2252122559
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
2252222560
\end{array}}
2252322561
\ExtraVSP\ExtraVSP
22524-
\RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{%
22525-
\Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22562+
% ------------------------------------------------ Named Function Type
22563+
\RuleRawRaw{\SrnNamedFunctionType}{}{%
22564+
\Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2252622565
\Subtype{\Delta'}{S_0}{T_0} &
22527-
\forall j \in 1 .. n\!:\;\Subtype{\Delta'}{T_j}{S_j} \\
22566+
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
2252822567
\{\,\List{y}{n+1}{n+k_2}\,\} \subseteq \{\,\List{x}{n+1}{n+k_1}\,\} \\
2252922568
\forall p \in 1 .. k_2, q \in 1 .. k_1:\quad
2253022569
y_{n+p} = x_{n+q}\quad\Rightarrow\quad\Subtype{\Delta'}{T_{n+p}}{S_{n+q}}}{%
@@ -22534,14 +22573,15 @@ \subsection{Subtypes}
2253422573
\end{array}}
2253522574
%
2253622575
\ExtraVSP
22537-
\RuleRaw{\SrnCovariance}{Covariance}{%
22538-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}} &
22539-
\forall j \in 1 .. s\!:\;\SubtypeStd{S_j}{T_j}}{%
22576+
% ------------------------------------------------ Covariance
22577+
\RuleRaw{\SrnCovariance}{}{%
22578+
\mbox{$C$ is an interface type with $s$ type parameters} &
22579+
\SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
2254022580
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
2254122581
\ExtraVSP
22542-
%% !!! Should include mixins (and other non-class interface types, if any).
22543-
\RuleRaw{\SrnSuperinterface}{Superinterface}{%
22544-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}}\\
22582+
% ------------------------------------------------ Superinterface
22583+
\RuleRaw{\SrnSuperinterface}{}{%
22584+
\mbox{$C$ is an interface type with type parameters \List{X}{1}{s}}\\
2254522585
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
2254622586
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
2254722587
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -23909,7 +23949,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2390923949
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
2391023950
if \SubtypeNE{T_1}{T_2}.
2391123951

23912-
\commentary{
23952+
\commentary{%
2391323953
In this and in the following cases, both types must be interface types.%
2391423954
}
2391523955
\item
@@ -24166,7 +24206,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2416624206
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
2416724207
\end{itemize}
2416824208

24169-
\rationale{
24209+
\rationale{%
2417024210
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
2417124211
are somewhat redundant in that they explicitly specify
2417224212
a lot of pairs of symmetric cases.

0 commit comments

Comments
 (0)