@@ -13959,7 +13959,7 @@ \subsection{Lookup}
13959
13959
13960
13960
{ % Scope for `lookup' definition.
13961
13961
13962
- \def\LookupDefinitionWithStart#1{
13962
+ \def\LookupDefinitionWithStart#1{%
13963
13963
\LMHash{}%
13964
13964
The result of a
13965
13965
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14282,7 +14282,7 @@ \subsection{Member Invocations}
14282
14282
expression $r$ is an expression of
14283
14283
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
14284
14284
Each member invocation has a
14285
- \IndexCustom{corresponding member name}{
14285
+ \IndexCustom{corresponding member name}{%
14286
14286
member invocation!corresponding member name}
14287
14287
as shown in the figure.
14288
14288
@@ -15982,7 +15982,7 @@ \subsection{Null Shorting}
15982
15982
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
15983
15983
is defined as follows:
15984
15984
15985
- {
15985
+ {%
15986
15986
\def\Base#1{\textcolor{normativeColor}{#1}}
15987
15987
\def\Meta#1{\textcolor{metaColor}{#1}}
15988
15988
\begin{metaLevelCode}
@@ -22407,29 +22407,27 @@ \subsection{Subtypes}
22407
22407
\newcommand{\SrnRightTop}{2}
22408
22408
\newcommand{\SrnLeftTop}{3}
22409
22409
\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}
22433
22431
22434
22432
\begin{figure}[p]
22435
22433
\def\VSP{\vspace{4mm}}
@@ -22442,56 +22440,96 @@ \subsection{Subtypes}
22442
22440
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
22443
22441
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
22444
22442
%
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
+ % ----------------------------------------------------------------------
22445
22464
\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$?}}
22453
22478
\end{minipage}
22454
22479
\begin{minipage}[c]{0.49\textwidth}
22455
- \RuleRaw{\SrnRightTop}{Right Top}{%
22480
+ % ------------------------------------------------ Right Top
22481
+ \RuleRaw{\SrnRightTop}{}{%
22456
22482
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}{}{%
22463
22485
$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}{%
22467
22491
\code{Null}}{\code{FutureOr<$T$>}}
22468
22492
\end{minipage}
22469
22493
22470
22494
\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}{%
22474
22501
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}{%
22477
22507
\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}
22479
22510
\end{minipage}
22480
22511
\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}{%
22482
22514
\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}
22490
22527
\end{minipage}
22491
22528
%
22492
22529
\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\} &
22495
22533
\Subtype{\Delta'}{S_0}{T_0} \\
22496
22534
n_1 \leq n_2 &
22497
22535
n_1 + k_1 \geq n_2 + k_2 &
@@ -22501,10 +22539,11 @@ \subsection{Subtypes}
22501
22539
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
22502
22540
\end{array}}
22503
22541
\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\} &
22506
22545
\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} \\
22508
22547
\{\,\List{y}{n+1}{n+k_2}\,\} \subseteq \{\,\List{x}{n+1}{n+k_1}\,\} \\
22509
22548
\forall p \in 1 .. k_2, q \in 1 .. k_1:\quad
22510
22549
y_{n+p} = x_{n+q}\quad\Rightarrow\quad\Subtype{\Delta'}{T_{n+p}}{S_{n+q}}}{%
@@ -22514,14 +22553,15 @@ \subsection{Subtypes}
22514
22553
\end{array}}
22515
22554
%
22516
22555
\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$}}{%
22520
22560
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
22521
22561
\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 }}\\
22525
22565
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
22526
22566
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
22527
22567
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -23889,7 +23929,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
23889
23929
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
23890
23930
if \SubtypeNE{T_1}{T_2}.
23891
23931
23892
- \commentary{
23932
+ \commentary{%
23893
23933
In this and in the following cases, both types must be interface types.%
23894
23934
}
23895
23935
\item
@@ -24146,7 +24186,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
24146
24186
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
24147
24187
\end{itemize}
24148
24188
24149
- \rationale{
24189
+ \rationale{%
24150
24190
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
24151
24191
are somewhat redundant in that they explicitly specify
24152
24192
a lot of pairs of symmetric cases.
0 commit comments