Skip to content

Commit 90618a0

Browse files
committed
Rebase
1 parent ba792d3 commit 90618a0

File tree

1 file changed

+107
-67
lines changed

1 file changed

+107
-67
lines changed

specification/dartLangSpec.tex

Lines changed: 107 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -13697,7 +13697,7 @@ \subsection{Lookup}
1369713697

1369813698
{ % Scope for `lookup' definition.
1369913699

13700-
\def\LookupDefinitionWithStart#1{
13700+
\def\LookupDefinitionWithStart#1{%
1370113701
\LMHash{}%
1370213702
The result of a
1370313703
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14020,7 +14020,7 @@ \subsection{Member Invocations}
1402014020
expression $r$ is an expression of
1402114021
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
1402214022
Each member invocation has a
14023-
\IndexCustom{corresponding member name}{
14023+
\IndexCustom{corresponding member name}{%
1402414024
member invocation!corresponding member name}
1402514025
as shown in the figure.
1402614026

@@ -15662,7 +15662,7 @@ \subsection{Null Shorting}
1566215662
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
1566315663
is defined as follows:
1566415664

15665-
{
15665+
{%
1566615666
\def\Base#1{\textcolor{normativeColor}{#1}}
1566715667
\def\Meta#1{\textcolor{metaColor}{#1}}
1566815668
\begin{metaLevelCode}
@@ -21979,29 +21979,27 @@ \subsection{Subtypes}
2197921979
\newcommand{\SrnRightTop}{2}
2198021980
\newcommand{\SrnLeftTop}{3}
2198121981
\newcommand{\SrnBottom}{4}
21982-
\newcommand{\SrnRightObjectOne}{5.1}
21983-
\newcommand{\SrnRightObjectTwo}{5.2}
21984-
\newcommand{\SrnRightObjectThree}{5.3}
21985-
\newcommand{\SrnRightObjectFour}{5.4}
21986-
\newcommand{\SrnNullOne}{6.1}
21987-
\newcommand{\SrnNullTwo}{6.2}
21988-
\newcommand{\SrnLeftFutureOr}{7}
21989-
\newcommand{\SrnLeftNullable}{7b}
21990-
\newcommand{\SrnTypeVariableReflexivityA}{8}
21991-
\newcommand{\SrnRightPromotedVariable}{9}
21992-
\newcommand{\SrnRightFutureOrA}{10}
21993-
\newcommand{\SrnRightFutureOrB}{11}
21994-
\newcommand{\SrnRightNullableOne}{11b.1}
21995-
\newcommand{\SrnRightNullableTwo}{11b.2}
21996-
\newcommand{\SrnRightNullableThree}{11b.3}
21997-
\newcommand{\SrnRightNullableFour}{11b.4}
21998-
\newcommand{\SrnLeftPromotedVariable}{12}
21999-
\newcommand{\SrnLeftVariableBound}{13}
22000-
\newcommand{\SrnRightFunction}{14}
22001-
\newcommand{\SrnPositionalFunctionType}{15}
22002-
\newcommand{\SrnNamedFunctionType}{16}
22003-
\newcommand{\SrnCovariance}{17}
22004-
\newcommand{\SrnSuperinterface}{18}
21982+
%\newcommand{\SrnRightObjectOne}{}
21983+
%\newcommand{\SrnRightObjectTwo}{}
21984+
%\newcommand{\SrnRightObjectThree}{}
21985+
\newcommand{\SrnRightObjectFour}{5}
21986+
\newcommand{\SrnNullOne}{6}
21987+
\newcommand{\SrnNullTwo}{7}
21988+
\newcommand{\SrnLeftFutureOr}{8}
21989+
\newcommand{\SrnLeftNullable}{9}
21990+
\newcommand{\SrnTypeVariableReflexivityA}{10}
21991+
\newcommand{\SrnRightPromotedVariable}{11}
21992+
\newcommand{\SrnRightFutureOrA}{12}
21993+
\newcommand{\SrnRightFutureOrB}{13}
21994+
\newcommand{\SrnRightNullableOne}{14}
21995+
\newcommand{\SrnRightNullableTwo}{15}
21996+
\newcommand{\SrnLeftPromotedVariable}{16}
21997+
\newcommand{\SrnLeftVariableBound}{17}
21998+
\newcommand{\SrnRightFunction}{18}
21999+
\newcommand{\SrnPositionalFunctionType}{19}
22000+
\newcommand{\SrnNamedFunctionType}{20}
22001+
\newcommand{\SrnCovariance}{21}
22002+
\newcommand{\SrnSuperinterface}{22}
2200522003

2200622004
\begin{figure}[p]
2200722005
\def\VSP{\vspace{4mm}}
@@ -22014,55 +22012,95 @@ \subsection{Subtypes}
2201422012
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
2201522013
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
2201622014
%
22015+
% ----------------------------------------------------------------------
22016+
% Omitted rules stated here, with justification for
22017+
% the omission.
22018+
% ------------------------------------------------ Right Object 1
22019+
% Not needed unless algorithmic: Instance of
22020+
% \SrnLeftVariableBound.
22021+
% \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22022+
% \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22023+
% }{X}{\code{Object}}
22024+
% ------------------------------------------------ Right Object 2
22025+
% Not needed unless algorithmic: Instance of
22026+
% \SrnLeftPromotedVariable.
22027+
% \RuleRaw{\SrnRightObjectTwo}{}{%
22028+
% \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22029+
% ------------------------------------------------ Right Object 3
22030+
% Not needed unless algorithmic: Derivable from
22031+
% \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22032+
% Future<S> <: Object).
22033+
% \RuleRaw{\SrnRightObjectThree}{}{%
22034+
% \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22035+
% ----------------------------------------------------------------------
2201722036
\begin{minipage}[c]{0.49\textwidth}
22018-
\Axiom{\SrnReflexivity}{Reflexivity}{T}{T}
22019-
\Axiom{\SrnBottom}{Left Bottom}{\code{Never}}{T}
22020-
\RuleRaw{\SrnRightObjectTwo}{Right Object 2}{%
22021-
\SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22022-
\RuleRaw{\SrnRightObjectThree}{Right Object 3}{%
22023-
\SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22024-
\Axiom{\SrnNullOne}{Left Null One}{\code{Null}}{\code{$T$?}}
22037+
% ------------------------------------------------ Reflexivity
22038+
\Axiom{\SrnReflexivity}{}{T}{T}
22039+
\ExtraVSP
22040+
% ------------------------------------------------ Left Top
22041+
% Non-algorithmic justification for this rule: Needed
22042+
% to prove dynamic/void <: FutureOr<Object>?.
22043+
\RuleRaw{\SrnLeftTop}{}{%
22044+
S \in \{\DYNAMIC, \VOID\}\\
22045+
\SubtypeStd{\code{Object?}}{T}}{S}{T}
22046+
% ------------------------------------------------ Left Bottom
22047+
\Axiom{\SrnBottom}{}{\code{Never}}{T}
22048+
% ------------------------------------------------ Left Null 1
22049+
\Axiom{\SrnNullOne}{}{\code{Null}}{\code{$T$?}}
2202522050
\end{minipage}
2202622051
\begin{minipage}[c]{0.49\textwidth}
22027-
\RuleRaw{\SrnRightTop}{Right Top}{%
22052+
% ------------------------------------------------ Right Top
22053+
\RuleRaw{\SrnRightTop}{}{%
2202822054
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22029-
\RuleRaw{\SrnLeftTop}{Left Top}{%
22030-
S \in \{\DYNAMIC, \VOID\} & \SubtypeStd{\code{Object?}}{T}}{S}{T}
22031-
\RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22032-
\code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22033-
}{X}{\code{Object}}
22034-
\RuleRaw{\SrnRightObjectFour}{Right Object 4}{%
22055+
% ------------------------------------------------ Right Object 4
22056+
\RuleRaw{\SrnRightObjectFour}{}{%
2203522057
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22036-
\mbox{$S$ is not of the form \code{$U$?}, $X$, %
22037-
\code{$X$\,\&\,$U$}, \code{FutureOr<$U$>}}}{S}{\code{Object}}
22038-
\Rule{\SrnNullTwo}{Left Null Two}{\code{Null}}{T}{%
22058+
\mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22059+
\mbox{\code{$X$\,\&\,$U$}, %
22060+
or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22061+
% ------------------------------------------------ Left Null 2
22062+
\Rule{\SrnNullTwo}{}{\code{Null}}{T}{%
2203922063
\code{Null}}{\code{FutureOr<$T$>}}
2204022064
\end{minipage}
2204122065

2204222066
\begin{minipage}[c]{0.49\textwidth}
22043-
\RuleTwo{\SrnLeftFutureOr}{Left FutureOr}{S}{T}{%
22044-
\code{Future<$S$>}}{T}{\code{FutureOr<$S$>}}{T}
22045-
\RuleTwo{\SrnRightPromotedVariable}{Right Promoted Variable}{S}{X}{S}{T}{%
22067+
% ------------------------------------------------ Left FutureOr
22068+
\RuleTwo{\SrnLeftFutureOr}{}{%
22069+
\code{Future<$S$>}}{T}{S}{T}{%
22070+
\code{FutureOr<$S$>}}{T}
22071+
% ------------------------------------------------ Right Promoted Variable
22072+
\RuleTwo{\SrnRightPromotedVariable}{}{S}{X}{S}{T}{%
2204622073
S}{X \& T}
22047-
\Rule{\SrnRightFutureOrB}{Right FutureOr B}{S}{T}{S}{\code{FutureOr<$T$>}}
22048-
\Rule{\SrnRightNullableTwo}{Right Nullable 2}{S}{\code{Null}}{S}{%
22074+
% ------------------------------------------------ Right FutureOr B
22075+
\Rule{\SrnRightFutureOrB}{}{S}{T}{S}{%
22076+
\code{FutureOr<$T$>}}
22077+
% ------------------------------------------------ Right Nullable 2
22078+
\Rule{\SrnRightNullableTwo}{}{S}{\code{Null}}{S}{%
2204922079
\code{$T$?}}
22050-
\Rule{\SrnLeftVariableBound}{Left Variable Bound}{\Gamma(X)}{T}{X}{T}
22080+
% ------------------------------------------------ Left Variable Bound
22081+
\Rule{\SrnLeftVariableBound}{}{\Gamma(X)}{T}{X}{T}
2205122082
\end{minipage}
2205222083
\begin{minipage}[c]{0.49\textwidth}
22053-
\RuleTwo{\SrnLeftNullable}{Left Nullable}{S}{T}{\code{Null}}{T}{
22084+
% ------------------------------------------------ Left Nullable
22085+
\RuleTwo{\SrnLeftNullable}{}{S}{T}{\code{Null}}{T}{%
2205422086
\code{$S$?}}{T}
22055-
\Axiom{\SrnTypeVariableReflexivityA}{Left Promoted Variable A}{X \& S}{X}
22056-
\Rule{\SrnRightFutureOrA}{Right FutureOr A}{S}{\code{Future<$T$>}}{%
22057-
S}{\code{FutureOr<$T$>}}
22058-
\Rule{\SrnRightNullableOne}{Right Nullable 1}{S}{T}{S}{\code{$T$?}}
22059-
\Rule{\SrnLeftPromotedVariable}{Left Promoted Variable B}{S}{T}{X \& S}{T}
22060-
\RuleRaw{\SrnRightFunction}{Right Function}{T\mbox{ is a function type}}{%
22061-
T}{\FUNCTION}
22087+
% ------------------------------------------------ Left Promoted Variable A
22088+
\Axiom{\SrnTypeVariableReflexivityA}{}{X \& S}{X}
22089+
% ------------------------------------------------ Right FutureOr A
22090+
\Rule{\SrnRightFutureOrA}{}{S}{%
22091+
\code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22092+
% ------------------------------------------------ Right Nullable 1
22093+
\Rule{\SrnRightNullableOne}{}{S}{T}{S}{\code{$T$?}}
22094+
% ------------------------------------------------ Left Promoted Variable B
22095+
\Rule{\SrnLeftPromotedVariable}{}{S}{T}{X \& S}{T}
22096+
% ------------------------------------------------ Right Function
22097+
\RuleRaw{\SrnRightFunction}{}{%
22098+
T\mbox{ is a function type}}{T}{\FUNCTION}
2206222099
\end{minipage}
2206322100
%
2206422101
\ExtraVSP
22065-
\RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22102+
% ------------------------------------------------ Positional Function Type
22103+
\RuleRawRaw{\SrnPositionalFunctionType}{}{%
2206622104
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2206722105
\Subtype{\Gamma'}{S_0}{T_0} \\
2206822106
n_1 \leq n_2 &
@@ -22073,7 +22111,8 @@ \subsection{Subtypes}
2207322111
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
2207422112
\end{array}}
2207522113
\ExtraVSP\ExtraVSP
22076-
\RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{%
22114+
% ------------------------------------------------ Named Function Type
22115+
\RuleRawRaw{\SrnNamedFunctionType}{}{%
2207722116
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2207822117
\Subtype{\Gamma'}{S_0}{T_0} &
2207922118
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
@@ -22086,14 +22125,15 @@ \subsection{Subtypes}
2208622125
\end{array}}
2208722126
%
2208822127
\ExtraVSP
22089-
\RuleRaw{\SrnCovariance}{Covariance}{%
22090-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}} &
22091-
\forall j \in 1 .. s\!:\;\SubtypeStd{S_j}{T_j}}{%
22128+
% ------------------------------------------------ Covariance
22129+
\RuleRaw{\SrnCovariance}{}{%
22130+
\mbox{$C$ is an interface type with $s$ type parameters} &
22131+
\SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
2209222132
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
2209322133
\ExtraVSP
22094-
%% !!! Should include mixins (and other non-class interface types, if any).
22095-
\RuleRaw{\SrnSuperinterface}{Superinterface}{%
22096-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}}\\
22134+
% ------------------------------------------------ Superinterface
22135+
\RuleRaw{\SrnSuperinterface}{}{%
22136+
\mbox{$C$ is an interface type with type parameters \List{X}{1}{s}}\\
2209722137
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
2209822138
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
2209922139
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -23459,7 +23499,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2345923499
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
2346023500
if \SubtypeNE{T_1}{T_2}.
2346123501

23462-
\commentary{
23502+
\commentary{%
2346323503
In this and in the following cases, both types must be interface types.%
2346423504
}
2346523505
\item
@@ -23716,7 +23756,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2371623756
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
2371723757
\end{itemize}
2371823758

23719-
\rationale{
23759+
\rationale{%
2372023760
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
2372123761
are somewhat redundant in that they explicitly specify
2372223762
a lot of pairs of symmetric cases.

0 commit comments

Comments
 (0)