@@ -13978,7 +13978,7 @@ \subsection{Lookup}
13978
13978
13979
13979
{ % Scope for `lookup' definition.
13980
13980
13981
- \def\LookupDefinitionWithStart#1{
13981
+ \def\LookupDefinitionWithStart#1{%
13982
13982
\LMHash{}%
13983
13983
The result of a
13984
13984
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14301,7 +14301,7 @@ \subsection{Member Invocations}
14301
14301
expression $r$ is an expression of
14302
14302
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
14303
14303
Each member invocation has a
14304
- \IndexCustom{corresponding member name}{
14304
+ \IndexCustom{corresponding member name}{%
14305
14305
member invocation!corresponding member name}
14306
14306
as shown in the figure.
14307
14307
@@ -16001,7 +16001,7 @@ \subsection{Null Shorting}
16001
16001
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
16002
16002
is defined as follows:
16003
16003
16004
- {
16004
+ {%
16005
16005
\def\Base#1{\textcolor{normativeColor}{#1}}
16006
16006
\def\Meta#1{\textcolor{metaColor}{#1}}
16007
16007
\begin{metaLevelCode}
@@ -22427,29 +22427,27 @@ \subsection{Subtypes}
22427
22427
\newcommand{\SrnRightTop}{2}
22428
22428
\newcommand{\SrnLeftTop}{3}
22429
22429
\newcommand{\SrnBottom}{4}
22430
- \newcommand{\SrnRightObjectOne}{5.1}
22431
- \newcommand{\SrnRightObjectTwo}{5.2}
22432
- \newcommand{\SrnRightObjectThree}{5.3}
22433
- \newcommand{\SrnRightObjectFour}{5.4}
22434
- \newcommand{\SrnNullOne}{6.1}
22435
- \newcommand{\SrnNullTwo}{6.2}
22436
- \newcommand{\SrnLeftFutureOr}{7}
22437
- \newcommand{\SrnLeftNullable}{7b}
22438
- \newcommand{\SrnTypeVariableReflexivityA}{8}
22439
- \newcommand{\SrnRightPromotedVariable}{9}
22440
- \newcommand{\SrnRightFutureOrA}{10}
22441
- \newcommand{\SrnRightFutureOrB}{11}
22442
- \newcommand{\SrnRightNullableOne}{11b.1}
22443
- \newcommand{\SrnRightNullableTwo}{11b.2}
22444
- \newcommand{\SrnRightNullableThree}{11b.3}
22445
- \newcommand{\SrnRightNullableFour}{11b.4}
22446
- \newcommand{\SrnLeftPromotedVariable}{12}
22447
- \newcommand{\SrnLeftVariableBound}{13}
22448
- \newcommand{\SrnRightFunction}{14}
22449
- \newcommand{\SrnPositionalFunctionType}{15}
22450
- \newcommand{\SrnNamedFunctionType}{16}
22451
- \newcommand{\SrnCovariance}{17}
22452
- \newcommand{\SrnSuperinterface}{18}
22430
+ %\newcommand{\SrnRightObjectOne}{}
22431
+ %\newcommand{\SrnRightObjectTwo}{}
22432
+ %\newcommand{\SrnRightObjectThree}{}
22433
+ \newcommand{\SrnRightObjectFour}{5}
22434
+ \newcommand{\SrnNullOne}{6}
22435
+ \newcommand{\SrnNullTwo}{7}
22436
+ \newcommand{\SrnLeftFutureOr}{8}
22437
+ \newcommand{\SrnLeftNullable}{9}
22438
+ \newcommand{\SrnTypeVariableReflexivityA}{10}
22439
+ \newcommand{\SrnRightPromotedVariable}{11}
22440
+ \newcommand{\SrnRightFutureOrA}{12}
22441
+ \newcommand{\SrnRightFutureOrB}{13}
22442
+ \newcommand{\SrnRightNullableOne}{14}
22443
+ \newcommand{\SrnRightNullableTwo}{15}
22444
+ \newcommand{\SrnLeftPromotedVariable}{16}
22445
+ \newcommand{\SrnLeftVariableBound}{17}
22446
+ \newcommand{\SrnRightFunction}{18}
22447
+ \newcommand{\SrnPositionalFunctionType}{19}
22448
+ \newcommand{\SrnNamedFunctionType}{20}
22449
+ \newcommand{\SrnCovariance}{21}
22450
+ \newcommand{\SrnSuperinterface}{22}
22453
22451
22454
22452
\begin{figure}[p]
22455
22453
\def\VSP{\vspace{4mm}}
@@ -22462,56 +22460,96 @@ \subsection{Subtypes}
22462
22460
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
22463
22461
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
22464
22462
%
22463
+ % ----------------------------------------------------------------------
22464
+ % Omitted rules stated here, with justification for
22465
+ % the omission.
22466
+ % ------------------------------------------------ Right Object 1
22467
+ % Not needed unless algorithmic: Instance of
22468
+ % \SrnLeftVariableBound.
22469
+ % \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22470
+ % \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22471
+ % }{X}{\code{Object}}
22472
+ % ------------------------------------------------ Right Object 2
22473
+ % Not needed unless algorithmic: Instance of
22474
+ % \SrnLeftPromotedVariable.
22475
+ % \RuleRaw{\SrnRightObjectTwo}{}{%
22476
+ % \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22477
+ % ------------------------------------------------ Right Object 3
22478
+ % Not needed unless algorithmic: Derivable from
22479
+ % \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22480
+ % Future<S> <: Object).
22481
+ % \RuleRaw{\SrnRightObjectThree}{}{%
22482
+ % \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22483
+ % ----------------------------------------------------------------------
22465
22484
\begin{minipage}[c]{0.49\textwidth}
22466
- \Axiom{\SrnReflexivity}{Reflexivity}{T}{T}
22467
- \Axiom{\SrnBottom}{Left Bottom}{\code{Never}}{T}
22468
- \RuleRaw{\SrnRightObjectTwo}{Right Object 2}{%
22469
- \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22470
- \RuleRaw{\SrnRightObjectThree}{Right Object 3}{%
22471
- \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22472
- \Axiom{\SrnNullOne}{Left Null One}{\code{Null}}{\code{$T$?}}
22485
+ % ------------------------------------------------ Reflexivity
22486
+ \Axiom{\SrnReflexivity}{}{T}{T}
22487
+ \ExtraVSP
22488
+ % ------------------------------------------------ Left Top
22489
+ % Non-algorithmic justification for this rule: Needed
22490
+ % to prove dynamic/void <: FutureOr<Object>?.
22491
+ \RuleRaw{\SrnLeftTop}{}{%
22492
+ S \in \{\DYNAMIC, \VOID\}\\
22493
+ \SubtypeStd{\code{Object?}}{T}}{S}{T}
22494
+ % ------------------------------------------------ Left Bottom
22495
+ \Axiom{\SrnBottom}{}{\code{Never}}{T}
22496
+ % ------------------------------------------------ Left Null 1
22497
+ \Axiom{\SrnNullOne}{}{\code{Null}}{\code{$T$?}}
22473
22498
\end{minipage}
22474
22499
\begin{minipage}[c]{0.49\textwidth}
22475
- \RuleRaw{\SrnRightTop}{Right Top}{%
22500
+ % ------------------------------------------------ Right Top
22501
+ \RuleRaw{\SrnRightTop}{}{%
22476
22502
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22477
- \RuleRaw{\SrnLeftTop}{Left Top}{%
22478
- S \in \{\DYNAMIC, \VOID\} & \SubtypeStd{\code{Object?}}{T}}{S}{T}
22479
- \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22480
- \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22481
- }{X}{\code{Object}}
22482
- \RuleRaw{\SrnRightObjectFour}{Right Object 4}{%
22503
+ % ------------------------------------------------ Right Object 4
22504
+ \RuleRaw{\SrnRightObjectFour}{}{%
22483
22505
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22484
- \mbox{$S$ is not of the form \code{$U$?}, $X$, %
22485
- \code{$X$\,\&\,$U$}, \code{FutureOr<$U$>}}}{S}{\code{Object}}
22486
- \Rule{\SrnNullTwo}{Left Null Two}{\code{Null}}{T}{%
22506
+ \mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22507
+ \mbox{\code{$X$\,\&\,$U$}, %
22508
+ or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22509
+ % ------------------------------------------------ Left Null 2
22510
+ \Rule{\SrnNullTwo}{}{\code{Null}}{T}{%
22487
22511
\code{Null}}{\code{FutureOr<$T$>}}
22488
22512
\end{minipage}
22489
22513
22490
22514
\begin{minipage}[c]{0.49\textwidth}
22491
- \RuleTwo{\SrnLeftFutureOr}{Left FutureOr}{S}{T}{%
22492
- \code{Future<$S$>}}{T}{\code{FutureOr<$S$>}}{T}
22493
- \RuleTwo{\SrnRightPromotedVariable}{Right Promoted Variable}{S}{X}{S}{T}{%
22515
+ % ------------------------------------------------ Left FutureOr
22516
+ \RuleTwo{\SrnLeftFutureOr}{}{%
22517
+ \code{Future<$S$>}}{T}{S}{T}{%
22518
+ \code{FutureOr<$S$>}}{T}
22519
+ % ------------------------------------------------ Right Promoted Variable
22520
+ \RuleTwo{\SrnRightPromotedVariable}{}{S}{X}{S}{T}{%
22494
22521
S}{X \& T}
22495
- \Rule{\SrnRightFutureOrB}{Right FutureOr B}{S}{T}{S}{\code{FutureOr<$T$>}}
22496
- \Rule{\SrnRightNullableTwo}{Right Nullable 2}{S}{\code{Null}}{S}{%
22522
+ % ------------------------------------------------ Right FutureOr B
22523
+ \Rule{\SrnRightFutureOrB}{}{S}{T}{S}{%
22524
+ \code{FutureOr<$T$>}}
22525
+ % ------------------------------------------------ Right Nullable 2
22526
+ \Rule{\SrnRightNullableTwo}{}{S}{\code{Null}}{S}{%
22497
22527
\code{$T$?}}
22498
- \Rule{\SrnLeftVariableBound}{Left Variable Bound}{\Delta(X)}{T}{X}{T}
22528
+ % ------------------------------------------------ Left Variable Bound
22529
+ \Rule{\SrnLeftVariableBound}{}{\Delta(X)}{T}{X}{T}
22499
22530
\end{minipage}
22500
22531
\begin{minipage}[c]{0.49\textwidth}
22501
- \RuleTwo{\SrnLeftNullable}{Left Nullable}{S}{T}{\code{Null}}{T}{
22532
+ % ------------------------------------------------ Left Nullable
22533
+ \RuleTwo{\SrnLeftNullable}{}{S}{T}{\code{Null}}{T}{%
22502
22534
\code{$S$?}}{T}
22503
- \Axiom{\SrnTypeVariableReflexivityA}{Left Promoted Variable A}{X \& S}{X}
22504
- \Rule{\SrnRightFutureOrA}{Right FutureOr A}{S}{\code{Future<$T$>}}{%
22505
- S}{\code{FutureOr<$T$>}}
22506
- \Rule{\SrnRightNullableOne}{Right Nullable 1}{S}{T}{S}{\code{$T$?}}
22507
- \Rule{\SrnLeftPromotedVariable}{Left Promoted Variable B}{S}{T}{X \& S}{T}
22508
- \RuleRaw{\SrnRightFunction}{Right Function}{T\mbox{ is a function type}}{%
22509
- T}{\FUNCTION}
22535
+ % ------------------------------------------------ Left Promoted Variable A
22536
+ \Axiom{\SrnTypeVariableReflexivityA}{}{X \& S}{X}
22537
+ % ------------------------------------------------ Right FutureOr A
22538
+ \Rule{\SrnRightFutureOrA}{}{S}{%
22539
+ \code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22540
+ % ------------------------------------------------ Right Nullable 1
22541
+ \Rule{\SrnRightNullableOne}{}{S}{T}{S}{\code{$T$?}}
22542
+ % ------------------------------------------------ Left Promoted Variable B
22543
+ \Rule{\SrnLeftPromotedVariable}{}{S}{T}{X \& S}{T}
22544
+ % ------------------------------------------------ Right Function
22545
+ \RuleRaw{\SrnRightFunction}{}{%
22546
+ T\mbox{ is a function type}}{T}{\FUNCTION}
22510
22547
\end{minipage}
22511
22548
%
22512
22549
\ExtraVSP
22513
- \RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22514
- \Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22550
+ % ------------------------------------------------ Positional Function Type
22551
+ \RuleRawRaw{\SrnPositionalFunctionType}{}{%
22552
+ \Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22515
22553
\Subtype{\Delta'}{S_0}{T_0} \\
22516
22554
n_1 \leq n_2 &
22517
22555
n_1 + k_1 \geq n_2 + k_2 &
@@ -22521,10 +22559,11 @@ \subsection{Subtypes}
22521
22559
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
22522
22560
\end{array}}
22523
22561
\ExtraVSP\ExtraVSP
22524
- \RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{%
22525
- \Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22562
+ % ------------------------------------------------ Named Function Type
22563
+ \RuleRawRaw{\SrnNamedFunctionType}{}{%
22564
+ \Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22526
22565
\Subtype{\Delta'}{S_0}{T_0} &
22527
- \forall j \in 1 .. n\!:\;\Subtype{\Delta '}{T_j}{S_j} \\
22566
+ \forall j \in 1 .. n\!:\;\Subtype{\Gamma '}{T_j}{S_j} \\
22528
22567
\{\,\List{y}{n+1}{n+k_2}\,\} \subseteq \{\,\List{x}{n+1}{n+k_1}\,\} \\
22529
22568
\forall p \in 1 .. k_2, q \in 1 .. k_1:\quad
22530
22569
y_{n+p} = x_{n+q}\quad\Rightarrow\quad\Subtype{\Delta'}{T_{n+p}}{S_{n+q}}}{%
@@ -22534,14 +22573,15 @@ \subsection{Subtypes}
22534
22573
\end{array}}
22535
22574
%
22536
22575
\ExtraVSP
22537
- \RuleRaw{\SrnCovariance}{Covariance}{%
22538
- \code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}} &
22539
- \forall j \in 1 .. s\!:\;\SubtypeStd{S_j}{T_j}}{%
22576
+ % ------------------------------------------------ Covariance
22577
+ \RuleRaw{\SrnCovariance}{}{%
22578
+ \mbox{$C$ is an interface type with $s$ type parameters} &
22579
+ \SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
22540
22580
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
22541
22581
\ExtraVSP
22542
- %% !!! Should include mixins (and other non-class interface types, if any).
22543
- \RuleRaw{\SrnSuperinterface}{Superinterface }{%
22544
- \code{\CLASS{} $C$<\TypeParametersNoBounds {X}{s}>\,\ldots\,\{\ }}\\
22582
+ % ------------------------------------------------ Superinterface
22583
+ \RuleRaw{\SrnSuperinterface}{}{%
22584
+ \mbox{ $C$ is an interface type with type parameters \List {X}{1}{s }}\\
22545
22585
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
22546
22586
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
22547
22587
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -23909,7 +23949,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
23909
23949
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
23910
23950
if \SubtypeNE{T_1}{T_2}.
23911
23951
23912
- \commentary{
23952
+ \commentary{%
23913
23953
In this and in the following cases, both types must be interface types.%
23914
23954
}
23915
23955
\item
@@ -24166,7 +24206,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
24166
24206
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
24167
24207
\end{itemize}
24168
24208
24169
- \rationale{
24209
+ \rationale{%
24170
24210
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
24171
24211
are somewhat redundant in that they explicitly specify
24172
24212
a lot of pairs of symmetric cases.
0 commit comments