@@ -14229,7 +14229,7 @@ \subsection{Lookup}
14229
14229
14230
14230
{ % Scope for `lookup' definition.
14231
14231
14232
- \def\LookupDefinitionWithStart#1{
14232
+ \def\LookupDefinitionWithStart#1{%
14233
14233
\LMHash{}%
14234
14234
The result of a
14235
14235
{\em {#1} lookup for $m$ in $o$ with respect to $L$ starting in class $C$}
@@ -14552,7 +14552,7 @@ \subsection{Member Invocations}
14552
14552
expression $r$ is an expression of
14553
14553
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
14554
14554
Each member invocation has a
14555
- \IndexCustom{corresponding member name}{
14555
+ \IndexCustom{corresponding member name}{%
14556
14556
member invocation!corresponding member name}
14557
14557
as shown in the figure.
14558
14558
@@ -16312,7 +16312,7 @@ \subsection{Null Shorting}
16312
16312
\IndexCustom{\metaCode{SHORT}}{null shorting!\metaCode{SHORT}}
16313
16313
is defined as follows:
16314
16314
16315
- {
16315
+ {%
16316
16316
\def\Base#1{\textcolor{normativeColor}{#1}}
16317
16317
\def\Meta#1{\textcolor{metaColor}{#1}}
16318
16318
\begin{metaLevelCode}
@@ -22858,29 +22858,27 @@ \subsection{Subtypes}
22858
22858
\newcommand{\SrnRightTop}{2}
22859
22859
\newcommand{\SrnLeftTop}{3}
22860
22860
\newcommand{\SrnBottom}{4}
22861
- \newcommand{\SrnRightObjectOne}{5.1}
22862
- \newcommand{\SrnRightObjectTwo}{5.2}
22863
- \newcommand{\SrnRightObjectThree}{5.3}
22864
- \newcommand{\SrnRightObjectFour}{5.4}
22865
- \newcommand{\SrnNullOne}{6.1}
22866
- \newcommand{\SrnNullTwo}{6.2}
22867
- \newcommand{\SrnLeftFutureOr}{7}
22868
- \newcommand{\SrnLeftNullable}{7b}
22869
- \newcommand{\SrnTypeVariableReflexivityA}{8}
22870
- \newcommand{\SrnRightPromotedVariable}{9}
22871
- \newcommand{\SrnRightFutureOrA}{10}
22872
- \newcommand{\SrnRightFutureOrB}{11}
22873
- \newcommand{\SrnRightNullableOne}{11b.1}
22874
- \newcommand{\SrnRightNullableTwo}{11b.2}
22875
- \newcommand{\SrnRightNullableThree}{11b.3}
22876
- \newcommand{\SrnRightNullableFour}{11b.4}
22877
- \newcommand{\SrnLeftPromotedVariable}{12}
22878
- \newcommand{\SrnLeftVariableBound}{13}
22879
- \newcommand{\SrnRightFunction}{14}
22880
- \newcommand{\SrnPositionalFunctionType}{15}
22881
- \newcommand{\SrnNamedFunctionType}{16}
22882
- \newcommand{\SrnCovariance}{17}
22883
- \newcommand{\SrnSuperinterface}{18}
22861
+ %\newcommand{\SrnRightObjectOne}{}
22862
+ %\newcommand{\SrnRightObjectTwo}{}
22863
+ %\newcommand{\SrnRightObjectThree}{}
22864
+ \newcommand{\SrnRightObjectFour}{5}
22865
+ \newcommand{\SrnNullOne}{6}
22866
+ \newcommand{\SrnNullTwo}{7}
22867
+ \newcommand{\SrnLeftFutureOr}{8}
22868
+ \newcommand{\SrnLeftNullable}{9}
22869
+ \newcommand{\SrnTypeVariableReflexivityA}{10}
22870
+ \newcommand{\SrnRightPromotedVariable}{11}
22871
+ \newcommand{\SrnRightFutureOrA}{12}
22872
+ \newcommand{\SrnRightFutureOrB}{13}
22873
+ \newcommand{\SrnRightNullableOne}{14}
22874
+ \newcommand{\SrnRightNullableTwo}{15}
22875
+ \newcommand{\SrnLeftPromotedVariable}{16}
22876
+ \newcommand{\SrnLeftVariableBound}{17}
22877
+ \newcommand{\SrnRightFunction}{18}
22878
+ \newcommand{\SrnPositionalFunctionType}{19}
22879
+ \newcommand{\SrnNamedFunctionType}{20}
22880
+ \newcommand{\SrnCovariance}{21}
22881
+ \newcommand{\SrnSuperinterface}{22}
22884
22882
22885
22883
\begin{figure}[p]
22886
22884
\def\VSP{\vspace{4mm}}
@@ -22893,56 +22891,96 @@ \subsection{Subtypes}
22893
22891
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
22894
22892
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
22895
22893
%
22894
+ % ----------------------------------------------------------------------
22895
+ % Omitted rules stated here, with justification for
22896
+ % the omission.
22897
+ % ------------------------------------------------ Right Object 1
22898
+ % Not needed unless algorithmic: Instance of
22899
+ % \SrnLeftVariableBound.
22900
+ % \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22901
+ % \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22902
+ % }{X}{\code{Object}}
22903
+ % ------------------------------------------------ Right Object 2
22904
+ % Not needed unless algorithmic: Instance of
22905
+ % \SrnLeftPromotedVariable.
22906
+ % \RuleRaw{\SrnRightObjectTwo}{}{%
22907
+ % \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22908
+ % ------------------------------------------------ Right Object 3
22909
+ % Not needed unless algorithmic: Derivable from
22910
+ % \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22911
+ % Future<S> <: Object).
22912
+ % \RuleRaw{\SrnRightObjectThree}{}{%
22913
+ % \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22914
+ % ----------------------------------------------------------------------
22896
22915
\begin{minipage}[c]{0.49\textwidth}
22897
- \Axiom{\SrnReflexivity}{Reflexivity}{T}{T}
22898
- \Axiom{\SrnBottom}{Left Bottom}{\code{Never}}{T}
22899
- \RuleRaw{\SrnRightObjectTwo}{Right Object 2}{%
22900
- \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22901
- \RuleRaw{\SrnRightObjectThree}{Right Object 3}{%
22902
- \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22903
- \Axiom{\SrnNullOne}{Left Null One}{\code{Null}}{\code{$T$?}}
22916
+ % ------------------------------------------------ Reflexivity
22917
+ \Axiom{\SrnReflexivity}{}{T}{T}
22918
+ \ExtraVSP
22919
+ % ------------------------------------------------ Left Top
22920
+ % Non-algorithmic justification for this rule: Needed
22921
+ % to prove dynamic/void <: FutureOr<Object>?.
22922
+ \RuleRaw{\SrnLeftTop}{}{%
22923
+ S \in \{\DYNAMIC, \VOID\}\\
22924
+ \SubtypeStd{\code{Object?}}{T}}{S}{T}
22925
+ % ------------------------------------------------ Left Bottom
22926
+ \Axiom{\SrnBottom}{}{\code{Never}}{T}
22927
+ % ------------------------------------------------ Left Null 1
22928
+ \Axiom{\SrnNullOne}{}{\code{Null}}{\code{$T$?}}
22904
22929
\end{minipage}
22905
22930
\begin{minipage}[c]{0.49\textwidth}
22906
- \RuleRaw{\SrnRightTop}{Right Top}{%
22931
+ % ------------------------------------------------ Right Top
22932
+ \RuleRaw{\SrnRightTop}{}{%
22907
22933
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22908
- \RuleRaw{\SrnLeftTop}{Left Top}{%
22909
- S \in \{\DYNAMIC, \VOID\} & \SubtypeStd{\code{Object?}}{T}}{S}{T}
22910
- \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
22911
- \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22912
- }{X}{\code{Object}}
22913
- \RuleRaw{\SrnRightObjectFour}{Right Object 4}{%
22934
+ % ------------------------------------------------ Right Object 4
22935
+ \RuleRaw{\SrnRightObjectFour}{}{%
22914
22936
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22915
- \mbox{$S$ is not of the form \code{$U$?}, $X$, %
22916
- \code{$X$\,\&\,$U$}, \code{FutureOr<$U$>}}}{S}{\code{Object}}
22917
- \Rule{\SrnNullTwo}{Left Null Two}{\code{Null}}{T}{%
22937
+ \mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22938
+ \mbox{\code{$X$\,\&\,$U$}, %
22939
+ or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22940
+ % ------------------------------------------------ Left Null 2
22941
+ \Rule{\SrnNullTwo}{}{\code{Null}}{T}{%
22918
22942
\code{Null}}{\code{FutureOr<$T$>}}
22919
22943
\end{minipage}
22920
22944
22921
22945
\begin{minipage}[c]{0.49\textwidth}
22922
- \RuleTwo{\SrnLeftFutureOr}{Left FutureOr}{S}{T}{%
22923
- \code{Future<$S$>}}{T}{\code{FutureOr<$S$>}}{T}
22924
- \RuleTwo{\SrnRightPromotedVariable}{Right Promoted Variable}{S}{X}{S}{T}{%
22946
+ % ------------------------------------------------ Left FutureOr
22947
+ \RuleTwo{\SrnLeftFutureOr}{}{%
22948
+ \code{Future<$S$>}}{T}{S}{T}{%
22949
+ \code{FutureOr<$S$>}}{T}
22950
+ % ------------------------------------------------ Right Promoted Variable
22951
+ \RuleTwo{\SrnRightPromotedVariable}{}{S}{X}{S}{T}{%
22925
22952
S}{X \& T}
22926
- \Rule{\SrnRightFutureOrB}{Right FutureOr B}{S}{T}{S}{\code{FutureOr<$T$>}}
22927
- \Rule{\SrnRightNullableTwo}{Right Nullable 2}{S}{\code{Null}}{S}{%
22953
+ % ------------------------------------------------ Right FutureOr B
22954
+ \Rule{\SrnRightFutureOrB}{}{S}{T}{S}{%
22955
+ \code{FutureOr<$T$>}}
22956
+ % ------------------------------------------------ Right Nullable 2
22957
+ \Rule{\SrnRightNullableTwo}{}{S}{\code{Null}}{S}{%
22928
22958
\code{$T$?}}
22929
- \Rule{\SrnLeftVariableBound}{Left Variable Bound}{\Delta(X)}{T}{X}{T}
22959
+ % ------------------------------------------------ Left Variable Bound
22960
+ \Rule{\SrnLeftVariableBound}{}{\Delta(X)}{T}{X}{T}
22930
22961
\end{minipage}
22931
22962
\begin{minipage}[c]{0.49\textwidth}
22932
- \RuleTwo{\SrnLeftNullable}{Left Nullable}{S}{T}{\code{Null}}{T}{
22963
+ % ------------------------------------------------ Left Nullable
22964
+ \RuleTwo{\SrnLeftNullable}{}{S}{T}{\code{Null}}{T}{%
22933
22965
\code{$S$?}}{T}
22934
- \Axiom{\SrnTypeVariableReflexivityA}{Left Promoted Variable A}{X \& S}{X}
22935
- \Rule{\SrnRightFutureOrA}{Right FutureOr A}{S}{\code{Future<$T$>}}{%
22936
- S}{\code{FutureOr<$T$>}}
22937
- \Rule{\SrnRightNullableOne}{Right Nullable 1}{S}{T}{S}{\code{$T$?}}
22938
- \Rule{\SrnLeftPromotedVariable}{Left Promoted Variable B}{S}{T}{X \& S}{T}
22939
- \RuleRaw{\SrnRightFunction}{Right Function}{T\mbox{ is a function type}}{%
22940
- T}{\FUNCTION}
22966
+ % ------------------------------------------------ Left Promoted Variable A
22967
+ \Axiom{\SrnTypeVariableReflexivityA}{}{X \& S}{X}
22968
+ % ------------------------------------------------ Right FutureOr A
22969
+ \Rule{\SrnRightFutureOrA}{}{S}{%
22970
+ \code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22971
+ % ------------------------------------------------ Right Nullable 1
22972
+ \Rule{\SrnRightNullableOne}{}{S}{T}{S}{\code{$T$?}}
22973
+ % ------------------------------------------------ Left Promoted Variable B
22974
+ \Rule{\SrnLeftPromotedVariable}{}{S}{T}{X \& S}{T}
22975
+ % ------------------------------------------------ Right Function
22976
+ \RuleRaw{\SrnRightFunction}{}{%
22977
+ T\mbox{ is a function type}}{T}{\FUNCTION}
22941
22978
\end{minipage}
22942
22979
%
22943
22980
\ExtraVSP
22944
- \RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22945
- \Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22981
+ % ------------------------------------------------ Positional Function Type
22982
+ \RuleRawRaw{\SrnPositionalFunctionType}{}{%
22983
+ \Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22946
22984
\Subtype{\Delta'}{S_0}{T_0} \\
22947
22985
n_1 \leq n_2 &
22948
22986
n_1 + k_1 \geq n_2 + k_2 &
@@ -22952,10 +22990,11 @@ \subsection{Subtypes}
22952
22990
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
22953
22991
\end{array}}
22954
22992
\ExtraVSP\ExtraVSP
22955
- \RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{%
22956
- \Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22993
+ % ------------------------------------------------ Named Function Type
22994
+ \RuleRawRaw{\SrnNamedFunctionType}{}{%
22995
+ \Gamma' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22957
22996
\Subtype{\Delta'}{S_0}{T_0} &
22958
- \forall j \in 1 .. n\!:\;\Subtype{\Delta '}{T_j}{S_j} \\
22997
+ \forall j \in 1 .. n\!:\;\Subtype{\Gamma '}{T_j}{S_j} \\
22959
22998
\{\,\List{y}{n+1}{n+k_2}\,\} \subseteq \{\,\List{x}{n+1}{n+k_1}\,\} \\
22960
22999
\forall p \in 1 .. k_2, q \in 1 .. k_1:\quad
22961
23000
y_{n+p} = x_{n+q}\quad\Rightarrow\quad\Subtype{\Delta'}{T_{n+p}}{S_{n+q}}}{%
@@ -22965,14 +23004,15 @@ \subsection{Subtypes}
22965
23004
\end{array}}
22966
23005
%
22967
23006
\ExtraVSP
22968
- \RuleRaw{\SrnCovariance}{Covariance}{%
22969
- \code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}} &
22970
- \forall j \in 1 .. s\!:\;\SubtypeStd{S_j}{T_j}}{%
23007
+ % ------------------------------------------------ Covariance
23008
+ \RuleRaw{\SrnCovariance}{}{%
23009
+ \mbox{$C$ is an interface type with $s$ type parameters} &
23010
+ \SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
22971
23011
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
22972
23012
\ExtraVSP
22973
- %% !!! Should include mixins (and other non-class interface types, if any).
22974
- \RuleRaw{\SrnSuperinterface}{Superinterface }{%
22975
- \code{\CLASS{} $C$<\TypeParametersNoBounds {X}{s}>\,\ldots\,\{\ }}\\
23013
+ % ------------------------------------------------ Superinterface
23014
+ \RuleRaw{\SrnSuperinterface}{}{%
23015
+ \mbox{ $C$ is an interface type with type parameters \List {X}{1}{s }}\\
22976
23016
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
22977
23017
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
22978
23018
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
@@ -24342,7 +24382,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
24342
24382
\DefEquals{\UpperBoundType{$T_1$}{$T_2$}}{T_2},
24343
24383
if \SubtypeNE{T_1}{T_2}.
24344
24384
24345
- \commentary{
24385
+ \commentary{%
24346
24386
In this and in the following cases, both types must be interface types.%
24347
24387
}
24348
24388
\item
@@ -24599,7 +24639,7 @@ \subsubsection{Standard Upper Bounds and Standard Lower Bounds}
24599
24639
\DefEquals{\LowerBoundType{$T_1$}{$T_2$}}{\code{Never}}, otherwise.
24600
24640
\end{itemize}
24601
24641
24602
- \rationale{
24642
+ \rationale{%
24603
24643
The rules defining \UpperBoundTypeName{} and \LowerBoundTypeName{}
24604
24644
are somewhat redundant in that they explicitly specify
24605
24645
a lot of pairs of symmetric cases.
0 commit comments