Skip to content

Commit 2526db5

Browse files
committed
Rebase
1 parent 3035052 commit 2526db5

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

1378413784
{ % Scope for `lookup' definition.
1378513785

13786-
\def\LookupDefinitionWithStart#1{
13786+
\def\LookupDefinitionWithStart#1{%
1378713787
\LMHash{}%
1378813788
The result of a
1378913789
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14106,7 +14106,7 @@ \subsection{Member Invocations}
1410614106
expression $r$ is an expression of
1410714107
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
1410814108
Each member invocation has a
14109-
\IndexCustom{corresponding member name}{
14109+
\IndexCustom{corresponding member name}{%
1411014110
member invocation!corresponding member name}
1411114111
as shown in the figure.
1411214112

@@ -15748,7 +15748,7 @@ \subsection{Null Shorting}
1574815748
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
1574915749
is defined as follows:
1575015750

15751-
{
15751+
{%
1575215752
\def\Base#1{\textcolor{normativeColor}{#1}}
1575315753
\def\Meta#1{\textcolor{metaColor}{#1}}
1575415754
\begin{metaLevelCode}
@@ -22106,29 +22106,27 @@ \subsection{Subtypes}
2210622106
\newcommand{\SrnRightTop}{2}
2210722107
\newcommand{\SrnLeftTop}{3}
2210822108
\newcommand{\SrnBottom}{4}
22109-
\newcommand{\SrnRightObjectOne}{5.1}
22110-
\newcommand{\SrnRightObjectTwo}{5.2}
22111-
\newcommand{\SrnRightObjectThree}{5.3}
22112-
\newcommand{\SrnRightObjectFour}{5.4}
22113-
\newcommand{\SrnNullOne}{6.1}
22114-
\newcommand{\SrnNullTwo}{6.2}
22115-
\newcommand{\SrnLeftFutureOr}{7}
22116-
\newcommand{\SrnLeftNullable}{7b}
22117-
\newcommand{\SrnTypeVariableReflexivityA}{8}
22118-
\newcommand{\SrnRightPromotedVariable}{9}
22119-
\newcommand{\SrnRightFutureOrA}{10}
22120-
\newcommand{\SrnRightFutureOrB}{11}
22121-
\newcommand{\SrnRightNullableOne}{11b.1}
22122-
\newcommand{\SrnRightNullableTwo}{11b.2}
22123-
\newcommand{\SrnRightNullableThree}{11b.3}
22124-
\newcommand{\SrnRightNullableFour}{11b.4}
22125-
\newcommand{\SrnLeftPromotedVariable}{12}
22126-
\newcommand{\SrnLeftVariableBound}{13}
22127-
\newcommand{\SrnRightFunction}{14}
22128-
\newcommand{\SrnPositionalFunctionType}{15}
22129-
\newcommand{\SrnNamedFunctionType}{16}
22130-
\newcommand{\SrnCovariance}{17}
22131-
\newcommand{\SrnSuperinterface}{18}
22109+
%\newcommand{\SrnRightObjectOne}{}
22110+
%\newcommand{\SrnRightObjectTwo}{}
22111+
%\newcommand{\SrnRightObjectThree}{}
22112+
\newcommand{\SrnRightObjectFour}{5}
22113+
\newcommand{\SrnNullOne}{6}
22114+
\newcommand{\SrnNullTwo}{7}
22115+
\newcommand{\SrnLeftFutureOr}{8}
22116+
\newcommand{\SrnLeftNullable}{9}
22117+
\newcommand{\SrnTypeVariableReflexivityA}{10}
22118+
\newcommand{\SrnRightPromotedVariable}{11}
22119+
\newcommand{\SrnRightFutureOrA}{12}
22120+
\newcommand{\SrnRightFutureOrB}{13}
22121+
\newcommand{\SrnRightNullableOne}{14}
22122+
\newcommand{\SrnRightNullableTwo}{15}
22123+
\newcommand{\SrnLeftPromotedVariable}{16}
22124+
\newcommand{\SrnLeftVariableBound}{17}
22125+
\newcommand{\SrnRightFunction}{18}
22126+
\newcommand{\SrnPositionalFunctionType}{19}
22127+
\newcommand{\SrnNamedFunctionType}{20}
22128+
\newcommand{\SrnCovariance}{21}
22129+
\newcommand{\SrnSuperinterface}{22}
2213222130

2213322131
\begin{figure}[p]
2213422132
\def\VSP{\vspace{4mm}}
@@ -22141,55 +22139,95 @@ \subsection{Subtypes}
2214122139
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
2214222140
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
2214322141
%
22142+
% ----------------------------------------------------------------------
22143+
% Omitted rules stated here, with justification for
22144+
% the omission.
22145+
% ------------------------------------------------ Right Object 1
22146+
% Not needed unless algorithmic: Instance of
22147+
% \SrnLeftVariableBound.
22148+
% \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22149+
% \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22150+
% }{X}{\code{Object}}
22151+
% ------------------------------------------------ Right Object 2
22152+
% Not needed unless algorithmic: Instance of
22153+
% \SrnLeftPromotedVariable.
22154+
% \RuleRaw{\SrnRightObjectTwo}{}{%
22155+
% \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22156+
% ------------------------------------------------ Right Object 3
22157+
% Not needed unless algorithmic: Derivable from
22158+
% \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22159+
% Future<S> <: Object).
22160+
% \RuleRaw{\SrnRightObjectThree}{}{%
22161+
% \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22162+
% ----------------------------------------------------------------------
2214422163
\begin{minipage}[c]{0.49\textwidth}
22145-
\Axiom{\SrnReflexivity}{Reflexivity}{T}{T}
22146-
\Axiom{\SrnBottom}{Left Bottom}{\code{Never}}{T}
22147-
\RuleRaw{\SrnRightObjectTwo}{Right Object 2}{%
22148-
\SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22149-
\RuleRaw{\SrnRightObjectThree}{Right Object 3}{%
22150-
\SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22151-
\Axiom{\SrnNullOne}{Left Null One}{\code{Null}}{\code{$T$?}}
22164+
% ------------------------------------------------ Reflexivity
22165+
\Axiom{\SrnReflexivity}{}{T}{T}
22166+
\ExtraVSP
22167+
% ------------------------------------------------ Left Top
22168+
% Non-algorithmic justification for this rule: Needed
22169+
% to prove dynamic/void <: FutureOr<Object>?.
22170+
\RuleRaw{\SrnLeftTop}{}{%
22171+
S \in \{\DYNAMIC, \VOID\}\\
22172+
\SubtypeStd{\code{Object?}}{T}}{S}{T}
22173+
% ------------------------------------------------ Left Bottom
22174+
\Axiom{\SrnBottom}{}{\code{Never}}{T}
22175+
% ------------------------------------------------ Left Null 1
22176+
\Axiom{\SrnNullOne}{}{\code{Null}}{\code{$T$?}}
2215222177
\end{minipage}
2215322178
\begin{minipage}[c]{0.49\textwidth}
22154-
\RuleRaw{\SrnRightTop}{Right Top}{%
22179+
% ------------------------------------------------ Right Top
22180+
\RuleRaw{\SrnRightTop}{}{%
2215522181
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22156-
\RuleRaw{\SrnLeftTop}{Left Top}{%
22157-
S \in \{\DYNAMIC, \VOID\} & \SubtypeStd{\code{Object?}}{T}}{S}{T}
22158-
\RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22159-
\code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22160-
}{X}{\code{Object}}
22161-
\RuleRaw{\SrnRightObjectFour}{Right Object 4}{%
22182+
% ------------------------------------------------ Right Object 4
22183+
\RuleRaw{\SrnRightObjectFour}{}{%
2216222184
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22163-
\mbox{$S$ is not of the form \code{$U$?}, $X$, %
22164-
\code{$X$\,\&\,$U$}, \code{FutureOr<$U$>}}}{S}{\code{Object}}
22165-
\Rule{\SrnNullTwo}{Left Null Two}{\code{Null}}{T}{%
22185+
\mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22186+
\mbox{\code{$X$\,\&\,$U$}, %
22187+
or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22188+
% ------------------------------------------------ Left Null 2
22189+
\Rule{\SrnNullTwo}{}{\code{Null}}{T}{%
2216622190
\code{Null}}{\code{FutureOr<$T$>}}
2216722191
\end{minipage}
2216822192

2216922193
\begin{minipage}[c]{0.49\textwidth}
22170-
\RuleTwo{\SrnLeftFutureOr}{Left FutureOr}{S}{T}{%
22171-
\code{Future<$S$>}}{T}{\code{FutureOr<$S$>}}{T}
22172-
\RuleTwo{\SrnRightPromotedVariable}{Right Promoted Variable}{S}{X}{S}{T}{%
22194+
% ------------------------------------------------ Left FutureOr
22195+
\RuleTwo{\SrnLeftFutureOr}{}{%
22196+
\code{Future<$S$>}}{T}{S}{T}{%
22197+
\code{FutureOr<$S$>}}{T}
22198+
% ------------------------------------------------ Right Promoted Variable
22199+
\RuleTwo{\SrnRightPromotedVariable}{}{S}{X}{S}{T}{%
2217322200
S}{X \& T}
22174-
\Rule{\SrnRightFutureOrB}{Right FutureOr B}{S}{T}{S}{\code{FutureOr<$T$>}}
22175-
\Rule{\SrnRightNullableTwo}{Right Nullable 2}{S}{\code{Null}}{S}{%
22201+
% ------------------------------------------------ Right FutureOr B
22202+
\Rule{\SrnRightFutureOrB}{}{S}{T}{S}{%
22203+
\code{FutureOr<$T$>}}
22204+
% ------------------------------------------------ Right Nullable 2
22205+
\Rule{\SrnRightNullableTwo}{}{S}{\code{Null}}{S}{%
2217622206
\code{$T$?}}
22177-
\Rule{\SrnLeftVariableBound}{Left Variable Bound}{\Gamma(X)}{T}{X}{T}
22207+
% ------------------------------------------------ Left Variable Bound
22208+
\Rule{\SrnLeftVariableBound}{}{\Gamma(X)}{T}{X}{T}
2217822209
\end{minipage}
2217922210
\begin{minipage}[c]{0.49\textwidth}
22180-
\RuleTwo{\SrnLeftNullable}{Left Nullable}{S}{T}{\code{Null}}{T}{
22211+
% ------------------------------------------------ Left Nullable
22212+
\RuleTwo{\SrnLeftNullable}{}{S}{T}{\code{Null}}{T}{%
2218122213
\code{$S$?}}{T}
22182-
\Axiom{\SrnTypeVariableReflexivityA}{Left Promoted Variable A}{X \& S}{X}
22183-
\Rule{\SrnRightFutureOrA}{Right FutureOr A}{S}{\code{Future<$T$>}}{%
22184-
S}{\code{FutureOr<$T$>}}
22185-
\Rule{\SrnRightNullableOne}{Right Nullable 1}{S}{T}{S}{\code{$T$?}}
22186-
\Rule{\SrnLeftPromotedVariable}{Left Promoted Variable B}{S}{T}{X \& S}{T}
22187-
\RuleRaw{\SrnRightFunction}{Right Function}{T\mbox{ is a function type}}{%
22188-
T}{\FUNCTION}
22214+
% ------------------------------------------------ Left Promoted Variable A
22215+
\Axiom{\SrnTypeVariableReflexivityA}{}{X \& S}{X}
22216+
% ------------------------------------------------ Right FutureOr A
22217+
\Rule{\SrnRightFutureOrA}{}{S}{%
22218+
\code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22219+
% ------------------------------------------------ Right Nullable 1
22220+
\Rule{\SrnRightNullableOne}{}{S}{T}{S}{\code{$T$?}}
22221+
% ------------------------------------------------ Left Promoted Variable B
22222+
\Rule{\SrnLeftPromotedVariable}{}{S}{T}{X \& S}{T}
22223+
% ------------------------------------------------ Right Function
22224+
\RuleRaw{\SrnRightFunction}{}{%
22225+
T\mbox{ is a function type}}{T}{\FUNCTION}
2218922226
\end{minipage}
2219022227
%
2219122228
\ExtraVSP
22192-
\RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22229+
% ------------------------------------------------ Positional Function Type
22230+
\RuleRawRaw{\SrnPositionalFunctionType}{}{%
2219322231
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2219422232
\Subtype{\Gamma'}{S_0}{T_0} \\
2219522233
n_1 \leq n_2 &
@@ -22200,7 +22238,8 @@ \subsection{Subtypes}
2220022238
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
2220122239
\end{array}}
2220222240
\ExtraVSP\ExtraVSP
22203-
\RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{%
22241+
% ------------------------------------------------ Named Function Type
22242+
\RuleRawRaw{\SrnNamedFunctionType}{}{%
2220422243
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2220522244
\Subtype{\Gamma'}{S_0}{T_0} &
2220622245
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
@@ -22213,14 +22252,15 @@ \subsection{Subtypes}
2221322252
\end{array}}
2221422253
%
2221522254
\ExtraVSP
22216-
\RuleRaw{\SrnCovariance}{Covariance}{%
22217-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}} &
22218-
\forall j \in 1 .. s\!:\;\SubtypeStd{S_j}{T_j}}{%
22255+
% ------------------------------------------------ Covariance
22256+
\RuleRaw{\SrnCovariance}{}{%
22257+
\mbox{$C$ is an interface type with $s$ type parameters} &
22258+
\SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
2221922259
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
2222022260
\ExtraVSP
22221-
%% !!! Should include mixins (and other non-class interface types, if any).
22222-
\RuleRaw{\SrnSuperinterface}{Superinterface}{%
22223-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}}\\
22261+
% ------------------------------------------------ Superinterface
22262+
\RuleRaw{\SrnSuperinterface}{}{%
22263+
\mbox{$C$ is an interface type with type parameters \List{X}{1}{s}}\\
2222422264
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
2222522265
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
2222622266
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -23586,7 +23626,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2358623626
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
2358723627
if \SubtypeNE{T_1}{T_2}.
2358823628

23589-
\commentary{
23629+
\commentary{%
2359023630
In this and in the following cases, both types must be interface types.%
2359123631
}
2359223632
\item
@@ -23843,7 +23883,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2384323883
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
2384423884
\end{itemize}
2384523885

23846-
\rationale{
23886+
\rationale{%
2384723887
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
2384823888
are somewhat redundant in that they explicitly specify
2384923889
a lot of pairs of symmetric cases.

0 commit comments

Comments
 (0)