Skip to content

Commit b67dabd

Browse files
committed
Rebase
1 parent 87ed29f commit b67dabd

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

1379813798
{ % Scope for `lookup' definition.
1379913799

13800-
\def\LookupDefinitionWithStart#1{
13800+
\def\LookupDefinitionWithStart#1{%
1380113801
\LMHash{}%
1380213802
The result of a
1380313803
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14120,7 +14120,7 @@ \subsection{Member Invocations}
1412014120
expression $r$ is an expression of
1412114121
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
1412214122
Each member invocation has a
14123-
\IndexCustom{corresponding member name}{
14123+
\IndexCustom{corresponding member name}{%
1412414124
member invocation!corresponding member name}
1412514125
as shown in the figure.
1412614126

@@ -15820,7 +15820,7 @@ \subsection{Null Shorting}
1582015820
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
1582115821
is defined as follows:
1582215822

15823-
{
15823+
{%
1582415824
\def\Base#1{\textcolor{normativeColor}{#1}}
1582515825
\def\Meta#1{\textcolor{metaColor}{#1}}
1582615826
\begin{metaLevelCode}
@@ -22244,29 +22244,27 @@ \subsection{Subtypes}
2224422244
\newcommand{\SrnRightTop}{2}
2224522245
\newcommand{\SrnLeftTop}{3}
2224622246
\newcommand{\SrnBottom}{4}
22247-
\newcommand{\SrnRightObjectOne}{5.1}
22248-
\newcommand{\SrnRightObjectTwo}{5.2}
22249-
\newcommand{\SrnRightObjectThree}{5.3}
22250-
\newcommand{\SrnRightObjectFour}{5.4}
22251-
\newcommand{\SrnNullOne}{6.1}
22252-
\newcommand{\SrnNullTwo}{6.2}
22253-
\newcommand{\SrnLeftFutureOr}{7}
22254-
\newcommand{\SrnLeftNullable}{7b}
22255-
\newcommand{\SrnTypeVariableReflexivityA}{8}
22256-
\newcommand{\SrnRightPromotedVariable}{9}
22257-
\newcommand{\SrnRightFutureOrA}{10}
22258-
\newcommand{\SrnRightFutureOrB}{11}
22259-
\newcommand{\SrnRightNullableOne}{11b.1}
22260-
\newcommand{\SrnRightNullableTwo}{11b.2}
22261-
\newcommand{\SrnRightNullableThree}{11b.3}
22262-
\newcommand{\SrnRightNullableFour}{11b.4}
22263-
\newcommand{\SrnLeftPromotedVariable}{12}
22264-
\newcommand{\SrnLeftVariableBound}{13}
22265-
\newcommand{\SrnRightFunction}{14}
22266-
\newcommand{\SrnPositionalFunctionType}{15}
22267-
\newcommand{\SrnNamedFunctionType}{16}
22268-
\newcommand{\SrnCovariance}{17}
22269-
\newcommand{\SrnSuperinterface}{18}
22247+
%\newcommand{\SrnRightObjectOne}{}
22248+
%\newcommand{\SrnRightObjectTwo}{}
22249+
%\newcommand{\SrnRightObjectThree}{}
22250+
\newcommand{\SrnRightObjectFour}{5}
22251+
\newcommand{\SrnNullOne}{6}
22252+
\newcommand{\SrnNullTwo}{7}
22253+
\newcommand{\SrnLeftFutureOr}{8}
22254+
\newcommand{\SrnLeftNullable}{9}
22255+
\newcommand{\SrnTypeVariableReflexivityA}{10}
22256+
\newcommand{\SrnRightPromotedVariable}{11}
22257+
\newcommand{\SrnRightFutureOrA}{12}
22258+
\newcommand{\SrnRightFutureOrB}{13}
22259+
\newcommand{\SrnRightNullableOne}{14}
22260+
\newcommand{\SrnRightNullableTwo}{15}
22261+
\newcommand{\SrnLeftPromotedVariable}{16}
22262+
\newcommand{\SrnLeftVariableBound}{17}
22263+
\newcommand{\SrnRightFunction}{18}
22264+
\newcommand{\SrnPositionalFunctionType}{19}
22265+
\newcommand{\SrnNamedFunctionType}{20}
22266+
\newcommand{\SrnCovariance}{21}
22267+
\newcommand{\SrnSuperinterface}{22}
2227022268

2227122269
\begin{figure}[p]
2227222270
\def\VSP{\vspace{4mm}}
@@ -22279,55 +22277,95 @@ \subsection{Subtypes}
2227922277
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
2228022278
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
2228122279
%
22280+
% ----------------------------------------------------------------------
22281+
% Omitted rules stated here, with justification for
22282+
% the omission.
22283+
% ------------------------------------------------ Right Object 1
22284+
% Not needed unless algorithmic: Instance of
22285+
% \SrnLeftVariableBound.
22286+
% \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22287+
% \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22288+
% }{X}{\code{Object}}
22289+
% ------------------------------------------------ Right Object 2
22290+
% Not needed unless algorithmic: Instance of
22291+
% \SrnLeftPromotedVariable.
22292+
% \RuleRaw{\SrnRightObjectTwo}{}{%
22293+
% \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22294+
% ------------------------------------------------ Right Object 3
22295+
% Not needed unless algorithmic: Derivable from
22296+
% \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22297+
% Future<S> <: Object).
22298+
% \RuleRaw{\SrnRightObjectThree}{}{%
22299+
% \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22300+
% ----------------------------------------------------------------------
2228222301
\begin{minipage}[c]{0.49\textwidth}
22283-
\Axiom{\SrnReflexivity}{Reflexivity}{T}{T}
22284-
\Axiom{\SrnBottom}{Left Bottom}{\code{Never}}{T}
22285-
\RuleRaw{\SrnRightObjectTwo}{Right Object 2}{%
22286-
\SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22287-
\RuleRaw{\SrnRightObjectThree}{Right Object 3}{%
22288-
\SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22289-
\Axiom{\SrnNullOne}{Left Null One}{\code{Null}}{\code{$T$?}}
22302+
% ------------------------------------------------ Reflexivity
22303+
\Axiom{\SrnReflexivity}{}{T}{T}
22304+
\ExtraVSP
22305+
% ------------------------------------------------ Left Top
22306+
% Non-algorithmic justification for this rule: Needed
22307+
% to prove dynamic/void <: FutureOr<Object>?.
22308+
\RuleRaw{\SrnLeftTop}{}{%
22309+
S \in \{\DYNAMIC, \VOID\}\\
22310+
\SubtypeStd{\code{Object?}}{T}}{S}{T}
22311+
% ------------------------------------------------ Left Bottom
22312+
\Axiom{\SrnBottom}{}{\code{Never}}{T}
22313+
% ------------------------------------------------ Left Null 1
22314+
\Axiom{\SrnNullOne}{}{\code{Null}}{\code{$T$?}}
2229022315
\end{minipage}
2229122316
\begin{minipage}[c]{0.49\textwidth}
22292-
\RuleRaw{\SrnRightTop}{Right Top}{%
22317+
% ------------------------------------------------ Right Top
22318+
\RuleRaw{\SrnRightTop}{}{%
2229322319
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22294-
\RuleRaw{\SrnLeftTop}{Left Top}{%
22295-
S \in \{\DYNAMIC, \VOID\} & \SubtypeStd{\code{Object?}}{T}}{S}{T}
22296-
\RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22297-
\code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22298-
}{X}{\code{Object}}
22299-
\RuleRaw{\SrnRightObjectFour}{Right Object 4}{%
22320+
% ------------------------------------------------ Right Object 4
22321+
\RuleRaw{\SrnRightObjectFour}{}{%
2230022322
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22301-
\mbox{$S$ is not of the form \code{$U$?}, $X$, %
22302-
\code{$X$\,\&\,$U$}, \code{FutureOr<$U$>}}}{S}{\code{Object}}
22303-
\Rule{\SrnNullTwo}{Left Null Two}{\code{Null}}{T}{%
22323+
\mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22324+
\mbox{\code{$X$\,\&\,$U$}, %
22325+
or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22326+
% ------------------------------------------------ Left Null 2
22327+
\Rule{\SrnNullTwo}{}{\code{Null}}{T}{%
2230422328
\code{Null}}{\code{FutureOr<$T$>}}
2230522329
\end{minipage}
2230622330

2230722331
\begin{minipage}[c]{0.49\textwidth}
22308-
\RuleTwo{\SrnLeftFutureOr}{Left FutureOr}{S}{T}{%
22309-
\code{Future<$S$>}}{T}{\code{FutureOr<$S$>}}{T}
22310-
\RuleTwo{\SrnRightPromotedVariable}{Right Promoted Variable}{S}{X}{S}{T}{%
22332+
% ------------------------------------------------ Left FutureOr
22333+
\RuleTwo{\SrnLeftFutureOr}{}{%
22334+
\code{Future<$S$>}}{T}{S}{T}{%
22335+
\code{FutureOr<$S$>}}{T}
22336+
% ------------------------------------------------ Right Promoted Variable
22337+
\RuleTwo{\SrnRightPromotedVariable}{}{S}{X}{S}{T}{%
2231122338
S}{X \& T}
22312-
\Rule{\SrnRightFutureOrB}{Right FutureOr B}{S}{T}{S}{\code{FutureOr<$T$>}}
22313-
\Rule{\SrnRightNullableTwo}{Right Nullable 2}{S}{\code{Null}}{S}{%
22339+
% ------------------------------------------------ Right FutureOr B
22340+
\Rule{\SrnRightFutureOrB}{}{S}{T}{S}{%
22341+
\code{FutureOr<$T$>}}
22342+
% ------------------------------------------------ Right Nullable 2
22343+
\Rule{\SrnRightNullableTwo}{}{S}{\code{Null}}{S}{%
2231422344
\code{$T$?}}
22315-
\Rule{\SrnLeftVariableBound}{Left Variable Bound}{\Gamma(X)}{T}{X}{T}
22345+
% ------------------------------------------------ Left Variable Bound
22346+
\Rule{\SrnLeftVariableBound}{}{\Gamma(X)}{T}{X}{T}
2231622347
\end{minipage}
2231722348
\begin{minipage}[c]{0.49\textwidth}
22318-
\RuleTwo{\SrnLeftNullable}{Left Nullable}{S}{T}{\code{Null}}{T}{
22349+
% ------------------------------------------------ Left Nullable
22350+
\RuleTwo{\SrnLeftNullable}{}{S}{T}{\code{Null}}{T}{%
2231922351
\code{$S$?}}{T}
22320-
\Axiom{\SrnTypeVariableReflexivityA}{Left Promoted Variable A}{X \& S}{X}
22321-
\Rule{\SrnRightFutureOrA}{Right FutureOr A}{S}{\code{Future<$T$>}}{%
22322-
S}{\code{FutureOr<$T$>}}
22323-
\Rule{\SrnRightNullableOne}{Right Nullable 1}{S}{T}{S}{\code{$T$?}}
22324-
\Rule{\SrnLeftPromotedVariable}{Left Promoted Variable B}{S}{T}{X \& S}{T}
22325-
\RuleRaw{\SrnRightFunction}{Right Function}{T\mbox{ is a function type}}{%
22326-
T}{\FUNCTION}
22352+
% ------------------------------------------------ Left Promoted Variable A
22353+
\Axiom{\SrnTypeVariableReflexivityA}{}{X \& S}{X}
22354+
% ------------------------------------------------ Right FutureOr A
22355+
\Rule{\SrnRightFutureOrA}{}{S}{%
22356+
\code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22357+
% ------------------------------------------------ Right Nullable 1
22358+
\Rule{\SrnRightNullableOne}{}{S}{T}{S}{\code{$T$?}}
22359+
% ------------------------------------------------ Left Promoted Variable B
22360+
\Rule{\SrnLeftPromotedVariable}{}{S}{T}{X \& S}{T}
22361+
% ------------------------------------------------ Right Function
22362+
\RuleRaw{\SrnRightFunction}{}{%
22363+
T\mbox{ is a function type}}{T}{\FUNCTION}
2232722364
\end{minipage}
2232822365
%
2232922366
\ExtraVSP
22330-
\RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22367+
% ------------------------------------------------ Positional Function Type
22368+
\RuleRawRaw{\SrnPositionalFunctionType}{}{%
2233122369
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2233222370
\Subtype{\Gamma'}{S_0}{T_0} \\
2233322371
n_1 \leq n_2 &
@@ -22338,7 +22376,8 @@ \subsection{Subtypes}
2233822376
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
2233922377
\end{array}}
2234022378
\ExtraVSP\ExtraVSP
22341-
\RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{%
22379+
% ------------------------------------------------ Named Function Type
22380+
\RuleRawRaw{\SrnNamedFunctionType}{}{%
2234222381
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
2234322382
\Subtype{\Gamma'}{S_0}{T_0} &
2234422383
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
@@ -22351,14 +22390,15 @@ \subsection{Subtypes}
2235122390
\end{array}}
2235222391
%
2235322392
\ExtraVSP
22354-
\RuleRaw{\SrnCovariance}{Covariance}{%
22355-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}} &
22356-
\forall j \in 1 .. s\!:\;\SubtypeStd{S_j}{T_j}}{%
22393+
% ------------------------------------------------ Covariance
22394+
\RuleRaw{\SrnCovariance}{}{%
22395+
\mbox{$C$ is an interface type with $s$ type parameters} &
22396+
\SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
2235722397
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
2235822398
\ExtraVSP
22359-
%% !!! Should include mixins (and other non-class interface types, if any).
22360-
\RuleRaw{\SrnSuperinterface}{Superinterface}{%
22361-
\code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}}\\
22399+
% ------------------------------------------------ Superinterface
22400+
\RuleRaw{\SrnSuperinterface}{}{%
22401+
\mbox{$C$ is an interface type with type parameters \List{X}{1}{s}}\\
2236222402
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
2236322403
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
2236422404
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -23724,7 +23764,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2372423764
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
2372523765
if \SubtypeNE{T_1}{T_2}.
2372623766

23727-
\commentary{
23767+
\commentary{%
2372823768
In this and in the following cases, both types must be interface types.%
2372923769
}
2373023770
\item
@@ -23981,7 +24021,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
2398124021
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
2398224022
\end{itemize}
2398324023

23984-
\rationale{
24024+
\rationale{%
2398524025
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
2398624026
are somewhat redundant in that they explicitly specify
2398724027
a lot of pairs of symmetric cases.

0 commit comments

Comments
 (0)