@@ -13783,7 +13783,7 @@ \subsection{Lookup}
13783
13783
13784
13784
{ % Scope for `lookup' definition.
13785
13785
13786
- \def\LookupDefinitionWithStart#1{
13786
+ \def\LookupDefinitionWithStart#1{%
13787
13787
\LMHash{}%
13788
13788
The result of a
13789
13789
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14106,7 +14106,7 @@ \subsection{Member Invocations}
14106
14106
expression $r$ is an expression of
14107
14107
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
14108
14108
Each member invocation has a
14109
- \IndexCustom{corresponding member name}{
14109
+ \IndexCustom{corresponding member name}{%
14110
14110
member invocation!corresponding member name}
14111
14111
as shown in the figure.
14112
14112
@@ -15748,7 +15748,7 @@ \subsection{Null Shorting}
15748
15748
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
15749
15749
is defined as follows:
15750
15750
15751
- {
15751
+ {%
15752
15752
\def\Base#1{\textcolor{normativeColor}{#1}}
15753
15753
\def\Meta#1{\textcolor{metaColor}{#1}}
15754
15754
\begin{metaLevelCode}
@@ -22106,29 +22106,27 @@ \subsection{Subtypes}
22106
22106
\newcommand{\SrnRightTop}{2}
22107
22107
\newcommand{\SrnLeftTop}{3}
22108
22108
\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}
22132
22130
22133
22131
\begin{figure}[p]
22134
22132
\def\VSP{\vspace{4mm}}
@@ -22141,55 +22139,95 @@ \subsection{Subtypes}
22141
22139
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
22142
22140
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
22143
22141
%
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
+ % ----------------------------------------------------------------------
22144
22163
\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$?}}
22152
22177
\end{minipage}
22153
22178
\begin{minipage}[c]{0.49\textwidth}
22154
- \RuleRaw{\SrnRightTop}{Right Top}{%
22179
+ % ------------------------------------------------ Right Top
22180
+ \RuleRaw{\SrnRightTop}{}{%
22155
22181
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}{}{%
22162
22184
$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}{%
22166
22190
\code{Null}}{\code{FutureOr<$T$>}}
22167
22191
\end{minipage}
22168
22192
22169
22193
\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}{%
22173
22200
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}{%
22176
22206
\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}
22178
22209
\end{minipage}
22179
22210
\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}{%
22181
22213
\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}
22189
22226
\end{minipage}
22190
22227
%
22191
22228
\ExtraVSP
22192
- \RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22229
+ % ------------------------------------------------ Positional Function Type
22230
+ \RuleRawRaw{\SrnPositionalFunctionType}{}{%
22193
22231
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22194
22232
\Subtype{\Gamma'}{S_0}{T_0} \\
22195
22233
n_1 \leq n_2 &
@@ -22200,7 +22238,8 @@ \subsection{Subtypes}
22200
22238
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
22201
22239
\end{array}}
22202
22240
\ExtraVSP\ExtraVSP
22203
- \RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{%
22241
+ % ------------------------------------------------ Named Function Type
22242
+ \RuleRawRaw{\SrnNamedFunctionType}{}{%
22204
22243
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22205
22244
\Subtype{\Gamma'}{S_0}{T_0} &
22206
22245
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
@@ -22213,14 +22252,15 @@ \subsection{Subtypes}
22213
22252
\end{array}}
22214
22253
%
22215
22254
\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$}}{%
22219
22259
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
22220
22260
\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 }}\\
22224
22264
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
22225
22265
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
22226
22266
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -23586,7 +23626,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
23586
23626
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
23587
23627
if \SubtypeNE{T_1}{T_2}.
23588
23628
23589
- \commentary{
23629
+ \commentary{%
23590
23630
In this and in the following cases, both types must be interface types.%
23591
23631
}
23592
23632
\item
@@ -23843,7 +23883,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
23843
23883
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
23844
23884
\end{itemize}
23845
23885
23846
- \rationale{
23886
+ \rationale{%
23847
23887
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
23848
23888
are somewhat redundant in that they explicitly specify
23849
23889
a lot of pairs of symmetric cases.
0 commit comments