Skip to content

Commit 3c30bdf

Browse files
committed
Rebase
1 parent e4e4860 commit 3c30bdf

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
@@ -13959,7 +13959,7 @@ \subsection{Lookup}
1395913959

1396013960
{ % Scope for `lookup' definition.
1396113961

13962-
\def\LookupDefinitionWithStart#1{
13962+
\def\LookupDefinitionWithStart#1{%
1396313963
\LMHash{}%
1396413964
The result of a
1396513965
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14282,7 +14282,7 @@ \subsection{Member Invocations}
1428214282
expression $r$ is an expression of
1428314283
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
1428414284
Each member invocation has a
14285-
\IndexCustom{corresponding member name}{
14285+
\IndexCustom{corresponding member name}{%
1428614286
member invocation!corresponding member name}
1428714287
as shown in the figure.
1428814288

@@ -15982,7 +15982,7 @@ \subsection{Null Shorting}
1598215982
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
1598315983
is defined as follows:
1598415984

15985-
{
15985+
{%
1598615986
\def\Base#1{\textcolor{normativeColor}{#1}}
1598715987
\def\Meta#1{\textcolor{metaColor}{#1}}
1598815988
\begin{metaLevelCode}
@@ -22407,29 +22407,27 @@ \subsection{Subtypes}
2240722407
\newcommand{\SrnRightTop}{2}
2240822408
\newcommand{\SrnLeftTop}{3}
2240922409
\newcommand{\SrnBottom}{4}
22410-
\newcommand{\SrnRightObjectOne}{5.1}
22411-
\newcommand{\SrnRightObjectTwo}{5.2}
22412-
\newcommand{\SrnRightObjectThree}{5.3}
22413-
\newcommand{\SrnRightObjectFour}{5.4}
22414-
\newcommand{\SrnNullOne}{6.1}
22415-
\newcommand{\SrnNullTwo}{6.2}
22416-
\newcommand{\SrnLeftFutureOr}{7}
22417-
\newcommand{\SrnLeftNullable}{7b}
22418-
\newcommand{\SrnTypeVariableReflexivityA}{8}
22419-
\newcommand{\SrnRightPromotedVariable}{9}
22420-
\newcommand{\SrnRightFutureOrA}{10}
22421-
\newcommand{\SrnRightFutureOrB}{11}
22422-
\newcommand{\SrnRightNullableOne}{11b.1}
22423-
\newcommand{\SrnRightNullableTwo}{11b.2}
22424-
\newcommand{\SrnRightNullableThree}{11b.3}
22425-
\newcommand{\SrnRightNullableFour}{11b.4}
22426-
\newcommand{\SrnLeftPromotedVariable}{12}
22427-
\newcommand{\SrnLeftVariableBound}{13}
22428-
\newcommand{\SrnRightFunction}{14}
22429-
\newcommand{\SrnPositionalFunctionType}{15}
22430-
\newcommand{\SrnNamedFunctionType}{16}
22431-
\newcommand{\SrnCovariance}{17}
22432-
\newcommand{\SrnSuperinterface}{18}
22410+
%\newcommand{\SrnRightObjectOne}{}
22411+
%\newcommand{\SrnRightObjectTwo}{}
22412+
%\newcommand{\SrnRightObjectThree}{}
22413+
\newcommand{\SrnRightObjectFour}{5}
22414+
\newcommand{\SrnNullOne}{6}
22415+
\newcommand{\SrnNullTwo}{7}
22416+
\newcommand{\SrnLeftFutureOr}{8}
22417+
\newcommand{\SrnLeftNullable}{9}
22418+
\newcommand{\SrnTypeVariableReflexivityA}{10}
22419+
\newcommand{\SrnRightPromotedVariable}{11}
22420+
\newcommand{\SrnRightFutureOrA}{12}
22421+
\newcommand{\SrnRightFutureOrB}{13}
22422+
\newcommand{\SrnRightNullableOne}{14}
22423+
\newcommand{\SrnRightNullableTwo}{15}
22424+
\newcommand{\SrnLeftPromotedVariable}{16}
22425+
\newcommand{\SrnLeftVariableBound}{17}
22426+
\newcommand{\SrnRightFunction}{18}
22427+
\newcommand{\SrnPositionalFunctionType}{19}
22428+
\newcommand{\SrnNamedFunctionType}{20}
22429+
\newcommand{\SrnCovariance}{21}
22430+
\newcommand{\SrnSuperinterface}{22}
2243322431

2243422432
\begin{figure}[p]
2243522433
\def\VSP{\vspace{4mm}}
@@ -22442,56 +22440,96 @@ \subsection{Subtypes}
2244222440
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
2244322441
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
2244422442
%
22443+
% ----------------------------------------------------------------------
22444+
% Omitted rules stated here, with justification for
22445+
% the omission.
22446+
% ------------------------------------------------ Right Object 1
22447+
% Not needed unless algorithmic: Instance of
22448+
% \SrnLeftVariableBound.
22449+
% \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22450+
% \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22451+
% }{X}{\code{Object}}
22452+
% ------------------------------------------------ Right Object 2
22453+
% Not needed unless algorithmic: Instance of
22454+
% \SrnLeftPromotedVariable.
22455+
% \RuleRaw{\SrnRightObjectTwo}{}{%
22456+
% \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22457+
% ------------------------------------------------ Right Object 3
22458+
% Not needed unless algorithmic: Derivable from
22459+
% \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22460+
% Future<S> <: Object).
22461+
% \RuleRaw{\SrnRightObjectThree}{}{%
22462+
% \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22463+
% ----------------------------------------------------------------------
2244522464
\begin{minipage}[c]{0.49\textwidth}
22446-
\Axiom{\SrnReflexivity}{Reflexivity}{T}{T}
22447-
\Axiom{\SrnBottom}{Left Bottom}{\code{Never}}{T}
22448-
\RuleRaw{\SrnRightObjectTwo}{Right Object 2}{%
22449-
\SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22450-
\RuleRaw{\SrnRightObjectThree}{Right Object 3}{%
22451-
\SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22452-
\Axiom{\SrnNullOne}{Left Null One}{\code{Null}}{\code{$T$?}}
22465+
% ------------------------------------------------ Reflexivity
22466+
\Axiom{\SrnReflexivity}{}{T}{T}
22467+
\ExtraVSP
22468+
% ------------------------------------------------ Left Top
22469+
% Non-algorithmic justification for this rule: Needed
22470+
% to prove dynamic/void <: FutureOr<Object>?.
22471+
\RuleRaw{\SrnLeftTop}{}{%
22472+
S \in \{\DYNAMIC, \VOID\}\\
22473+
\SubtypeStd{\code{Object?}}{T}}{S}{T}
22474+
% ------------------------------------------------ Left Bottom
22475+
\Axiom{\SrnBottom}{}{\code{Never}}{T}
22476+
% ------------------------------------------------ Left Null 1
22477+
\Axiom{\SrnNullOne}{}{\code{Null}}{\code{$T$?}}
2245322478
\end{minipage}
2245422479
\begin{minipage}[c]{0.49\textwidth}
22455-
\RuleRaw{\SrnRightTop}{Right Top}{%
22480+
% ------------------------------------------------ Right Top
22481+
\RuleRaw{\SrnRightTop}{}{%
2245622482
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22457-
\RuleRaw{\SrnLeftTop}{Left Top}{%
22458-
S \in \{\DYNAMIC, \VOID\} & \SubtypeStd{\code{Object?}}{T}}{S}{T}
22459-
\RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22460-
\code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22461-
}{X}{\code{Object}}
22462-
\RuleRaw{\SrnRightObjectFour}{Right Object 4}{%
22483+
% ------------------------------------------------ Right Object 4
22484+
\RuleRaw{\SrnRightObjectFour}{}{%
2246322485
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22464-
\mbox{$S$ is not of the form \code{$U$?}, $X$, %
22465-
\code{$X$\,\&\,$U$}, \code{FutureOr<$U$>}}}{S}{\code{Object}}
22466-
\Rule{\SrnNullTwo}{Left Null Two}{\code{Null}}{T}{%
22486+
\mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22487+
\mbox{\code{$X$\,\&\,$U$}, %
22488+
or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22489+
% ------------------------------------------------ Left Null 2
22490+
\Rule{\SrnNullTwo}{}{\code{Null}}{T}{%
2246722491
\code{Null}}{\code{FutureOr<$T$>}}
2246822492
\end{minipage}
2246922493

2247022494
\begin{minipage}[c]{0.49\textwidth}
22471-
\RuleTwo{\SrnLeftFutureOr}{Left FutureOr}{S}{T}{%
22472-
\code{Future<$S$>}}{T}{\code{FutureOr<$S$>}}{T}
22473-
\RuleTwo{\SrnRightPromotedVariable}{Right Promoted Variable}{S}{X}{S}{T}{%
22495+
% ------------------------------------------------ Left FutureOr
22496+
\RuleTwo{\SrnLeftFutureOr}{}{%
22497+
\code{Future<$S$>}}{T}{S}{T}{%
22498+
\code{FutureOr<$S$>}}{T}
22499+
% ------------------------------------------------ Right Promoted Variable
22500+
\RuleTwo{\SrnRightPromotedVariable}{}{S}{X}{S}{T}{%
2247422501
S}{X \& T}
22475-
\Rule{\SrnRightFutureOrB}{Right FutureOr B}{S}{T}{S}{\code{FutureOr<$T$>}}
22476-
\Rule{\SrnRightNullableTwo}{Right Nullable 2}{S}{\code{Null}}{S}{%
22502+
% ------------------------------------------------ Right FutureOr B
22503+
\Rule{\SrnRightFutureOrB}{}{S}{T}{S}{%
22504+
\code{FutureOr<$T$>}}
22505+
% ------------------------------------------------ Right Nullable 2
22506+
\Rule{\SrnRightNullableTwo}{}{S}{\code{Null}}{S}{%
2247722507
\code{$T$?}}
22478-
\Rule{\SrnLeftVariableBound}{Left Variable Bound}{\Delta(X)}{T}{X}{T}
22508+
% ------------------------------------------------ Left Variable Bound
22509+
\Rule{\SrnLeftVariableBound}{}{\Delta(X)}{T}{X}{T}
2247922510
\end{minipage}
2248022511
\begin{minipage}[c]{0.49\textwidth}
22481-
\RuleTwo{\SrnLeftNullable}{Left Nullable}{S}{T}{\code{Null}}{T}{
22512+
% ------------------------------------------------ Left Nullable
22513+
\RuleTwo{\SrnLeftNullable}{}{S}{T}{\code{Null}}{T}{%
2248222514
\code{$S$?}}{T}
22483-
\Axiom{\SrnTypeVariableReflexivityA}{Left Promoted Variable A}{X \& S}{X}
22484-
\Rule{\SrnRightFutureOrA}{Right FutureOr A}{S}{\code{Future<$T$>}}{%
22485-
S}{\code{FutureOr<$T$>}}
22486-
\Rule{\SrnRightNullableOne}{Right Nullable 1}{S}{T}{S}{\code{$T$?}}
22487-
\Rule{\SrnLeftPromotedVariable}{Left Promoted Variable B}{S}{T}{X \& S}{T}
22488-
\RuleRaw{\SrnRightFunction}{Right Function}{T\mbox{ is a function type}}{%
22489-
T}{\FUNCTION}
22515+
% ------------------------------------------------ Left Promoted Variable A
22516+
\Axiom{\SrnTypeVariableReflexivityA}{}{X \& S}{X}
22517+
% ------------------------------------------------ Right FutureOr A
22518+
\Rule{\SrnRightFutureOrA}{}{S}{%
22519+
\code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22520+
% ------------------------------------------------ Right Nullable 1
22521+
\Rule{\SrnRightNullableOne}{}{S}{T}{S}{\code{$T$?}}
22522+
% ------------------------------------------------ Left Promoted Variable B
22523+
\Rule{\SrnLeftPromotedVariable}{}{S}{T}{X \& S}{T}
22524+
% ------------------------------------------------ Right Function
22525+
\RuleRaw{\SrnRightFunction}{}{%
22526+
T\mbox{ is a function type}}{T}{\FUNCTION}
2249022527
\end{minipage}
2249122528
%
2249222529
\ExtraVSP
22493-
\RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22494-
\Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22530+
% ------------------------------------------------ Positional Function Type
22531+
\RuleRawRaw{\SrnPositionalFunctionType}{}{%
22532+
\Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2249522533
\Subtype{\Delta'}{S_0}{T_0} \\
2249622534
n_1 \leq n_2 &
2249722535
n_1 + k_1 \geq n_2 + k_2 &
@@ -22501,10 +22539,11 @@ \subsection{Subtypes}
2250122539
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
2250222540
\end{array}}
2250322541
\ExtraVSP\ExtraVSP
22504-
\RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{%
22505-
\Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22542+
% ------------------------------------------------ Named Function Type
22543+
\RuleRawRaw{\SrnNamedFunctionType}{}{%
22544+
\Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2250622545
\Subtype{\Delta'}{S_0}{T_0} &
22507-
\forall j \in 1 .. n\!:\;\Subtype{\Delta'}{T_j}{S_j} \\
22546+
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
2250822547
\{\,\List{y}{n+1}{n+k_2}\,\} \subseteq \{\,\List{x}{n+1}{n+k_1}\,\} \\
2250922548
\forall p \in 1 .. k_2, q \in 1 .. k_1:\quad
2251022549
y_{n+p} = x_{n+q}\quad\Rightarrow\quad\Subtype{\Delta'}{T_{n+p}}{S_{n+q}}}{%
@@ -22514,14 +22553,15 @@ \subsection{Subtypes}
2251422553
\end{array}}
2251522554
%
2251622555
\ExtraVSP
22517-
\RuleRaw{\SrnCovariance}{Covariance}{%
22518-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}} &
22519-
\forall j \in 1 .. s\!:\;\SubtypeStd{S_j}{T_j}}{%
22556+
% ------------------------------------------------ Covariance
22557+
\RuleRaw{\SrnCovariance}{}{%
22558+
\mbox{$C$ is an interface type with $s$ type parameters} &
22559+
\SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
2252022560
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
2252122561
\ExtraVSP
22522-
%% !!! Should include mixins (and other non-class interface types, if any).
22523-
\RuleRaw{\SrnSuperinterface}{Superinterface}{%
22524-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}}\\
22562+
% ------------------------------------------------ Superinterface
22563+
\RuleRaw{\SrnSuperinterface}{}{%
22564+
\mbox{$C$ is an interface type with type parameters \List{X}{1}{s}}\\
2252522565
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
2252622566
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
2252722567
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -23889,7 +23929,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2388923929
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
2389023930
if \SubtypeNE{T_1}{T_2}.
2389123931

23892-
\commentary{
23932+
\commentary{%
2389323933
In this and in the following cases, both types must be interface types.%
2389423934
}
2389523935
\item
@@ -24146,7 +24186,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2414624186
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
2414724187
\end{itemize}
2414824188

24149-
\rationale{
24189+
\rationale{%
2415024190
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
2415124191
are somewhat redundant in that they explicitly specify
2415224192
a lot of pairs of symmetric cases.

0 commit comments

Comments
 (0)