Skip to content

Commit 56d2ce1

Browse files
committed
Rebase
1 parent 26bf94b commit 56d2ce1

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

1423014230
{ % Scope for `lookup' definition.
1423114231

14232-
\def\LookupDefinitionWithStart#1{
14232+
\def\LookupDefinitionWithStart#1{%
1423314233
\LMHash{}%
1423414234
The result of a
1423514235
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14552,7 +14552,7 @@ \subsection{Member Invocations}
1455214552
expression $r$ is an expression of
1455314553
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
1455414554
Each member invocation has a
14555-
\IndexCustom{corresponding member name}{
14555+
\IndexCustom{corresponding member name}{%
1455614556
member invocation!corresponding member name}
1455714557
as shown in the figure.
1455814558

@@ -16312,7 +16312,7 @@ \subsection{Null Shorting}
1631216312
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
1631316313
is defined as follows:
1631416314

16315-
{
16315+
{%
1631616316
\def\Base#1{\textcolor{normativeColor}{#1}}
1631716317
\def\Meta#1{\textcolor{metaColor}{#1}}
1631816318
\begin{metaLevelCode}
@@ -22858,29 +22858,27 @@ \subsection{Subtypes}
2285822858
\newcommand{\SrnRightTop}{2}
2285922859
\newcommand{\SrnLeftTop}{3}
2286022860
\newcommand{\SrnBottom}{4}
22861-
\newcommand{\SrnRightObjectOne}{5.1}
22862-
\newcommand{\SrnRightObjectTwo}{5.2}
22863-
\newcommand{\SrnRightObjectThree}{5.3}
22864-
\newcommand{\SrnRightObjectFour}{5.4}
22865-
\newcommand{\SrnNullOne}{6.1}
22866-
\newcommand{\SrnNullTwo}{6.2}
22867-
\newcommand{\SrnLeftFutureOr}{7}
22868-
\newcommand{\SrnLeftNullable}{7b}
22869-
\newcommand{\SrnTypeVariableReflexivityA}{8}
22870-
\newcommand{\SrnRightPromotedVariable}{9}
22871-
\newcommand{\SrnRightFutureOrA}{10}
22872-
\newcommand{\SrnRightFutureOrB}{11}
22873-
\newcommand{\SrnRightNullableOne}{11b.1}
22874-
\newcommand{\SrnRightNullableTwo}{11b.2}
22875-
\newcommand{\SrnRightNullableThree}{11b.3}
22876-
\newcommand{\SrnRightNullableFour}{11b.4}
22877-
\newcommand{\SrnLeftPromotedVariable}{12}
22878-
\newcommand{\SrnLeftVariableBound}{13}
22879-
\newcommand{\SrnRightFunction}{14}
22880-
\newcommand{\SrnPositionalFunctionType}{15}
22881-
\newcommand{\SrnNamedFunctionType}{16}
22882-
\newcommand{\SrnCovariance}{17}
22883-
\newcommand{\SrnSuperinterface}{18}
22861+
%\newcommand{\SrnRightObjectOne}{}
22862+
%\newcommand{\SrnRightObjectTwo}{}
22863+
%\newcommand{\SrnRightObjectThree}{}
22864+
\newcommand{\SrnRightObjectFour}{5}
22865+
\newcommand{\SrnNullOne}{6}
22866+
\newcommand{\SrnNullTwo}{7}
22867+
\newcommand{\SrnLeftFutureOr}{8}
22868+
\newcommand{\SrnLeftNullable}{9}
22869+
\newcommand{\SrnTypeVariableReflexivityA}{10}
22870+
\newcommand{\SrnRightPromotedVariable}{11}
22871+
\newcommand{\SrnRightFutureOrA}{12}
22872+
\newcommand{\SrnRightFutureOrB}{13}
22873+
\newcommand{\SrnRightNullableOne}{14}
22874+
\newcommand{\SrnRightNullableTwo}{15}
22875+
\newcommand{\SrnLeftPromotedVariable}{16}
22876+
\newcommand{\SrnLeftVariableBound}{17}
22877+
\newcommand{\SrnRightFunction}{18}
22878+
\newcommand{\SrnPositionalFunctionType}{19}
22879+
\newcommand{\SrnNamedFunctionType}{20}
22880+
\newcommand{\SrnCovariance}{21}
22881+
\newcommand{\SrnSuperinterface}{22}
2288422882

2288522883
\begin{figure}[p]
2288622884
\def\VSP{\vspace{4mm}}
@@ -22893,56 +22891,96 @@ \subsection{Subtypes}
2289322891
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
2289422892
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
2289522893
%
22894+
% ----------------------------------------------------------------------
22895+
% Omitted rules stated here, with justification for
22896+
% the omission.
22897+
% ------------------------------------------------ Right Object 1
22898+
% Not needed unless algorithmic: Instance of
22899+
% \SrnLeftVariableBound.
22900+
% \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22901+
% \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22902+
% }{X}{\code{Object}}
22903+
% ------------------------------------------------ Right Object 2
22904+
% Not needed unless algorithmic: Instance of
22905+
% \SrnLeftPromotedVariable.
22906+
% \RuleRaw{\SrnRightObjectTwo}{}{%
22907+
% \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22908+
% ------------------------------------------------ Right Object 3
22909+
% Not needed unless algorithmic: Derivable from
22910+
% \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22911+
% Future<S> <: Object).
22912+
% \RuleRaw{\SrnRightObjectThree}{}{%
22913+
% \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22914+
% ----------------------------------------------------------------------
2289622915
\begin{minipage}[c]{0.49\textwidth}
22897-
\Axiom{\SrnReflexivity}{Reflexivity}{T}{T}
22898-
\Axiom{\SrnBottom}{Left Bottom}{\code{Never}}{T}
22899-
\RuleRaw{\SrnRightObjectTwo}{Right Object 2}{%
22900-
\SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22901-
\RuleRaw{\SrnRightObjectThree}{Right Object 3}{%
22902-
\SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22903-
\Axiom{\SrnNullOne}{Left Null One}{\code{Null}}{\code{$T$?}}
22916+
% ------------------------------------------------ Reflexivity
22917+
\Axiom{\SrnReflexivity}{}{T}{T}
22918+
\ExtraVSP
22919+
% ------------------------------------------------ Left Top
22920+
% Non-algorithmic justification for this rule: Needed
22921+
% to prove dynamic/void <: FutureOr<Object>?.
22922+
\RuleRaw{\SrnLeftTop}{}{%
22923+
S \in \{\DYNAMIC, \VOID\}\\
22924+
\SubtypeStd{\code{Object?}}{T}}{S}{T}
22925+
% ------------------------------------------------ Left Bottom
22926+
\Axiom{\SrnBottom}{}{\code{Never}}{T}
22927+
% ------------------------------------------------ Left Null 1
22928+
\Axiom{\SrnNullOne}{}{\code{Null}}{\code{$T$?}}
2290422929
\end{minipage}
2290522930
\begin{minipage}[c]{0.49\textwidth}
22906-
\RuleRaw{\SrnRightTop}{Right Top}{%
22931+
% ------------------------------------------------ Right Top
22932+
\RuleRaw{\SrnRightTop}{}{%
2290722933
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22908-
\RuleRaw{\SrnLeftTop}{Left Top}{%
22909-
S \in \{\DYNAMIC, \VOID\} & \SubtypeStd{\code{Object?}}{T}}{S}{T}
22910-
\RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22911-
\code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22912-
}{X}{\code{Object}}
22913-
\RuleRaw{\SrnRightObjectFour}{Right Object 4}{%
22934+
% ------------------------------------------------ Right Object 4
22935+
\RuleRaw{\SrnRightObjectFour}{}{%
2291422936
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22915-
\mbox{$S$ is not of the form \code{$U$?}, $X$, %
22916-
\code{$X$\,\&\,$U$}, \code{FutureOr<$U$>}}}{S}{\code{Object}}
22917-
\Rule{\SrnNullTwo}{Left Null Two}{\code{Null}}{T}{%
22937+
\mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22938+
\mbox{\code{$X$\,\&\,$U$}, %
22939+
or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22940+
% ------------------------------------------------ Left Null 2
22941+
\Rule{\SrnNullTwo}{}{\code{Null}}{T}{%
2291822942
\code{Null}}{\code{FutureOr<$T$>}}
2291922943
\end{minipage}
2292022944

2292122945
\begin{minipage}[c]{0.49\textwidth}
22922-
\RuleTwo{\SrnLeftFutureOr}{Left FutureOr}{S}{T}{%
22923-
\code{Future<$S$>}}{T}{\code{FutureOr<$S$>}}{T}
22924-
\RuleTwo{\SrnRightPromotedVariable}{Right Promoted Variable}{S}{X}{S}{T}{%
22946+
% ------------------------------------------------ Left FutureOr
22947+
\RuleTwo{\SrnLeftFutureOr}{}{%
22948+
\code{Future<$S$>}}{T}{S}{T}{%
22949+
\code{FutureOr<$S$>}}{T}
22950+
% ------------------------------------------------ Right Promoted Variable
22951+
\RuleTwo{\SrnRightPromotedVariable}{}{S}{X}{S}{T}{%
2292522952
S}{X \& T}
22926-
\Rule{\SrnRightFutureOrB}{Right FutureOr B}{S}{T}{S}{\code{FutureOr<$T$>}}
22927-
\Rule{\SrnRightNullableTwo}{Right Nullable 2}{S}{\code{Null}}{S}{%
22953+
% ------------------------------------------------ Right FutureOr B
22954+
\Rule{\SrnRightFutureOrB}{}{S}{T}{S}{%
22955+
\code{FutureOr<$T$>}}
22956+
% ------------------------------------------------ Right Nullable 2
22957+
\Rule{\SrnRightNullableTwo}{}{S}{\code{Null}}{S}{%
2292822958
\code{$T$?}}
22929-
\Rule{\SrnLeftVariableBound}{Left Variable Bound}{\Delta(X)}{T}{X}{T}
22959+
% ------------------------------------------------ Left Variable Bound
22960+
\Rule{\SrnLeftVariableBound}{}{\Delta(X)}{T}{X}{T}
2293022961
\end{minipage}
2293122962
\begin{minipage}[c]{0.49\textwidth}
22932-
\RuleTwo{\SrnLeftNullable}{Left Nullable}{S}{T}{\code{Null}}{T}{
22963+
% ------------------------------------------------ Left Nullable
22964+
\RuleTwo{\SrnLeftNullable}{}{S}{T}{\code{Null}}{T}{%
2293322965
\code{$S$?}}{T}
22934-
\Axiom{\SrnTypeVariableReflexivityA}{Left Promoted Variable A}{X \& S}{X}
22935-
\Rule{\SrnRightFutureOrA}{Right FutureOr A}{S}{\code{Future<$T$>}}{%
22936-
S}{\code{FutureOr<$T$>}}
22937-
\Rule{\SrnRightNullableOne}{Right Nullable 1}{S}{T}{S}{\code{$T$?}}
22938-
\Rule{\SrnLeftPromotedVariable}{Left Promoted Variable B}{S}{T}{X \& S}{T}
22939-
\RuleRaw{\SrnRightFunction}{Right Function}{T\mbox{ is a function type}}{%
22940-
T}{\FUNCTION}
22966+
% ------------------------------------------------ Left Promoted Variable A
22967+
\Axiom{\SrnTypeVariableReflexivityA}{}{X \& S}{X}
22968+
% ------------------------------------------------ Right FutureOr A
22969+
\Rule{\SrnRightFutureOrA}{}{S}{%
22970+
\code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22971+
% ------------------------------------------------ Right Nullable 1
22972+
\Rule{\SrnRightNullableOne}{}{S}{T}{S}{\code{$T$?}}
22973+
% ------------------------------------------------ Left Promoted Variable B
22974+
\Rule{\SrnLeftPromotedVariable}{}{S}{T}{X \& S}{T}
22975+
% ------------------------------------------------ Right Function
22976+
\RuleRaw{\SrnRightFunction}{}{%
22977+
T\mbox{ is a function type}}{T}{\FUNCTION}
2294122978
\end{minipage}
2294222979
%
2294322980
\ExtraVSP
22944-
\RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22945-
\Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22981+
% ------------------------------------------------ Positional Function Type
22982+
\RuleRawRaw{\SrnPositionalFunctionType}{}{%
22983+
\Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2294622984
\Subtype{\Delta'}{S_0}{T_0} \\
2294722985
n_1 \leq n_2 &
2294822986
n_1 + k_1 \geq n_2 + k_2 &
@@ -22952,10 +22990,11 @@ \subsection{Subtypes}
2295222990
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
2295322991
\end{array}}
2295422992
\ExtraVSP\ExtraVSP
22955-
\RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{%
22956-
\Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22993+
% ------------------------------------------------ Named Function Type
22994+
\RuleRawRaw{\SrnNamedFunctionType}{}{%
22995+
\Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2295722996
\Subtype{\Delta'}{S_0}{T_0} &
22958-
\forall j \in 1 .. n\!:\;\Subtype{\Delta'}{T_j}{S_j} \\
22997+
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
2295922998
\{\,\List{y}{n+1}{n+k_2}\,\} \subseteq \{\,\List{x}{n+1}{n+k_1}\,\} \\
2296022999
\forall p \in 1 .. k_2, q \in 1 .. k_1:\quad
2296123000
y_{n+p} = x_{n+q}\quad\Rightarrow\quad\Subtype{\Delta'}{T_{n+p}}{S_{n+q}}}{%
@@ -22965,14 +23004,15 @@ \subsection{Subtypes}
2296523004
\end{array}}
2296623005
%
2296723006
\ExtraVSP
22968-
\RuleRaw{\SrnCovariance}{Covariance}{%
22969-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}} &
22970-
\forall j \in 1 .. s\!:\;\SubtypeStd{S_j}{T_j}}{%
23007+
% ------------------------------------------------ Covariance
23008+
\RuleRaw{\SrnCovariance}{}{%
23009+
\mbox{$C$ is an interface type with $s$ type parameters} &
23010+
\SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
2297123011
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
2297223012
\ExtraVSP
22973-
%% !!! Should include mixins (and other non-class interface types, if any).
22974-
\RuleRaw{\SrnSuperinterface}{Superinterface}{%
22975-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}}\\
23013+
% ------------------------------------------------ Superinterface
23014+
\RuleRaw{\SrnSuperinterface}{}{%
23015+
\mbox{$C$ is an interface type with type parameters \List{X}{1}{s}}\\
2297623016
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
2297723017
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
2297823018
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -24342,7 +24382,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2434224382
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
2434324383
if \SubtypeNE{T_1}{T_2}.
2434424384

24345-
\commentary{
24385+
\commentary{%
2434624386
In this and in the following cases, both types must be interface types.%
2434724387
}
2434824388
\item
@@ -24599,7 +24639,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2459924639
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
2460024640
\end{itemize}
2460124641

24602-
\rationale{
24642+
\rationale{%
2460324643
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
2460424644
are somewhat redundant in that they explicitly specify
2460524645
a lot of pairs of symmetric cases.

0 commit comments

Comments
 (0)