@@ -6267,7 +6267,7 @@ \subsection{Explicit Invocation of an Instance Member of an Extension}
6267
6267
\IndexCustom{instantiated \ON{} type}{extension!instantiated \ON{} type}
6268
6268
of $a$ as $[T_1/X_1, \ldots, T_s/X_s]T$.
6269
6269
We define the
6270
- \IndexCustom{instantiation-to-bound \ON{} type}{
6270
+ \IndexCustom{instantiation-to-bound \ON{} type}{%
6271
6271
extension!instantiation-to-bound \ON{} type}
6272
6272
of $a$ as $[U_1/X_1, \ldots, U_s/X_s]T$,
6273
6273
where \List{U}{1}{s} is the result of instantiation to bound
@@ -6342,7 +6342,7 @@ \subsection{Explicit Invocation of an Instance Member of an Extension}
6342
6342
6343
6343
\LMHash{}%
6344
6344
The member signature $s_1$ is called the
6345
- \IndexCustom{invocation member signature}{
6345
+ \IndexCustom{invocation member signature}{%
6346
6346
extension!invocation member signature}
6347
6347
of $i$.
6348
6348
The static type of $i$ is the return type of
@@ -13953,7 +13953,7 @@ \subsection{Member Invocations}
13953
13953
expression $r$ is an expression of
13954
13954
one of the forms shown in Fig.~\ref{fig:memberInvocations}.
13955
13955
Each member invocation has a
13956
- \IndexCustom{corresponding member name}{
13956
+ \IndexCustom{corresponding member name}{%
13957
13957
member invocation!corresponding member name}
13958
13958
as shown in the figure.
13959
13959
@@ -14557,7 +14557,7 @@ \subsubsection{Superinvocations}
14557
14557
14558
14558
\LMHash{}%
14559
14559
An
14560
- \IndexCustom{implicit \CALL{} superinvocation}{
14560
+ \IndexCustom{implicit \CALL{} superinvocation}{%
14561
14561
method superinvocation!implicit \CALL}
14562
14562
has the form
14563
14563
@@ -21663,7 +21663,7 @@ \subsection{Type Aliases}
21663
21663
we say that the parameterized type $U$ of the form
21664
21664
\code{$F$<\List{U}{1}{s}>}
21665
21665
in a scope where $F$ resolves to $D$
21666
- \IndexCustom{alias expands in one step to}{
21666
+ \IndexCustom{alias expands in one step to}{%
21667
21667
type alias!alias expands in one step}
21668
21668
$[U_1/X_1, \ldots, U_s/X_s]T$.
21669
21669
@@ -21678,7 +21678,7 @@ \subsection{Type Aliases}
21678
21678
by its alias expansion in one step
21679
21679
(\commentary{including the non-generic case where there are no type arguments}).
21680
21680
When no further steps are possible we say that the resulting type is the
21681
- \IndexCustom{transitive alias expansion}{
21681
+ \IndexCustom{transitive alias expansion}{%
21682
21682
type alias!transitive alias expansion}
21683
21683
of $U$.
21684
21684
@@ -22017,18 +22017,20 @@ \subsection{Subtypes}
22017
22017
% ------------------------------------------------ Positional Function Type
22018
22018
\RuleRawRaw{\SrnPositionalFunctionType}{%
22019
22019
\Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22020
+ \forall i \in 1..s\!:\;\MutualSubtype{\Delta'}{B_i}{B'\!_i} &
22020
22021
\Subtype{\Delta'}{S_0}{T_0} \\
22021
22022
n_1 \leq n_2 &
22022
22023
n_1 + k_1 \geq n_2 + k_2 &
22023
22024
\forall j \in 1 .. n_2 + k_2\!:\;\Subtype{\Delta'}{T_j}{S_j}}{%
22024
22025
\begin{array}{c}
22025
22026
\Delta\vdash\RawFunctionTypePositional{S_0}{X}{B}{s}{S}{n_1}{k_1}\;<:\;\\
22026
- \RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
22027
+ \RawFunctionTypePositional{T_0}{X}{B'\! }{s}{T}{n_2}{k_2}
22027
22028
\end{array}}
22028
22029
\ExtraVSP\ExtraVSP
22029
22030
% ------------------------------------------------ Named Function Type
22030
22031
\RuleRawRaw{\SrnNamedFunctionType}{
22031
22032
\Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22033
+ \forall i \in 1..s\!:\;\MutualSubtype{\Delta'}{B_i}{B'\!_i} &
22032
22034
\Subtype{\Delta'}{S_0}{T_0} &
22033
22035
\forall j \in 1 .. n\!:\;\Subtype{\Delta'}{T_j}{S_j}\\
22034
22036
\{\,\List{y}{n+1}{n+k_2}\,\} \subseteq \{\,\List{x}{n+1}{n+k_1}\,\}\\
@@ -22038,13 +22040,16 @@ \subsection{Subtypes}
22038
22040
(r_{n+q} = \REQUIRED{} \Rightarrow r'_{n+p} = \REQUIRED)}{%
22039
22041
\begin{array}{c}
22040
22042
\Delta\vdash\RawFunctionTypeNamed{S_0}{X}{B}{s}{S}{n}{x}{k_1}{r}\;<:\;\\
22041
- \RawFunctionTypeNamed{T_0}{X}{B}{s}{T}{n}{y}{k_2}{r'}
22043
+ \RawFunctionTypeNamed{T_0}{X}{B'\! }{s}{T}{n}{y}{k_2}{r'}
22042
22044
\end{array}}
22043
22045
%
22044
22046
\ExtraVSP
22045
22047
% ------------------------------------------------ Covariance
22048
+ %% TODO(eernst): Type aliases have been expanded so there is no other
22049
+ %% variance than covariance, but there will be in/out/inout in classes,
22050
+ %% and then we'll need to handle variance here.
22046
22051
\RuleRaw{\SrnCovariance}{%
22047
- \mbox{$C$ is an interface type with $s$ type parameters} &
22052
+ \mbox{$C$ is an interface type with $s$ type parameters. } &
22048
22053
\SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
22049
22054
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
22050
22055
\ExtraVSP
@@ -22209,7 +22214,8 @@ \subsubsection{Subtype Rules}
22209
22214
In this specification we frequently refer to
22210
22215
subtype relationships and assignability
22211
22216
without mentioning the environment explicitly,
22212
- as in \Index{\SubtypeNE{S}{T}}.
22217
+ as in
22218
+ \IndexCustom{\SubtypeNE{S}{T}}{$<:$@\SubtypeNE{S}{T}}.
22213
22219
This is only done when a specific location in code is in focus,
22214
22220
and it means that the environment is that which is obtained
22215
22221
by mapping each type variable in scope at that location
@@ -22243,7 +22249,7 @@ \subsubsection{Being a Subtype}
22243
22249
A type $S$ is shown to be a \Index{subtype} of another type $T$
22244
22250
in an environment $\Delta$ by providing
22245
22251
an instantiation of a rule $R$ whose conclusion is
22246
- \IndexCustom{\SubtypeStd{S}{T}}{$\Delta$@\SubtypeStd{S}{T}},
22252
+ \IndexCustom{\SubtypeStd{S}{T}}{$\Delta<: $@\SubtypeStd{S}{T}},
22247
22253
along with rule instantiations showing
22248
22254
each of the premises of $R$,
22249
22255
continuing until a rule with no premises is reached.
@@ -22472,9 +22478,17 @@ \subsubsection{Additional Subtyping Concepts}
22472
22478
22473
22479
\LMHash{}%
22474
22480
$S$ is a \Index{supertype} of $T$ in a given environment $\Delta$,
22475
- written \SupertypeStd{S}{T},
22481
+ written
22482
+ \IndexCustom{\SupertypeStd{S}{T}}{$\Delta:>$@\SupertypeStd{S}{T}},
22476
22483
if{}f \SubtypeStd{T}{S}.
22477
22484
22485
+ \LMHash{}%
22486
+ $S$ and $T$ are \Index{mutual subtypes} of each other
22487
+ in a given environment $\Delta$,
22488
+ written
22489
+ \IndexCustom{\MutualSubtypeStd{S}{T}}{$\Delta<:>$@\MutualSubtypeStd{S}{T}},
22490
+ if{}f both \SubtypeStd{T}{S} and \SubtypeStd{S}{T}.
22491
+
22478
22492
\LMHash{}%
22479
22493
A type $T$
22480
22494
\Index{may be assigned}
@@ -22632,7 +22646,8 @@ \subsection{Functions Dealing with Extreme Types}
22632
22646
the first applicable case must be used.
22633
22647
22634
22648
\LMHash{}%
22635
- The \Index{\TopMergeTypeName} of two types computes
22649
+ The \IndexCustom{\TopMergeTypeName}{topMergeType@\TopMergeTypeName}
22650
+ of two types computes
22636
22651
a canonical type which represents both of them,
22637
22652
in the case where they are structurally identical
22638
22653
modulo the choice among top types.
@@ -22697,7 +22712,8 @@ \subsection{Functions Dealing with Extreme Types}
22697
22712
\commentary{The ordering of the arguments makes no difference.}
22698
22713
22699
22714
\LMHash{}%
22700
- The \Index{\IsTopTypeName} predicate is true for any type which is in
22715
+ The \IndexCustom{\IsTopTypeName}{isTopType@\IsTopTypeName}
22716
+ predicate is true for any type which is in
22701
22717
the equivalence class of top types.
22702
22718
It is a syntactic characterization of top types
22703
22719
(\ref{superBoundedTypes}).
@@ -22711,8 +22727,9 @@ \subsection{Functions Dealing with Extreme Types}
22711
22727
\end{itemize}
22712
22728
22713
22729
\noindent
22714
- The \Index{\IsObjectTypeName} predicate is true if{}f
22715
- the argument is a subtype and a supertype of \code{Object}.
22730
+ The \IndexCustom{\IsObjectTypeName}{isObjectType@\IsObjectTypeName}
22731
+ predicate is true if{}f the argument is
22732
+ a subtype and a supertype of \code{Object}.
22716
22733
22717
22734
\begin{itemize}
22718
22735
\item \DefEquals{\IsObjectType{Object}}{\metavar{true}}.
@@ -22721,8 +22738,8 @@ \subsection{Functions Dealing with Extreme Types}
22721
22738
\end{itemize}
22722
22739
22723
22740
\noindent
22724
- The \Index {\IsBottomTypeName} predicate is true if{}f
22725
- the argument is a subtype of \code{Never}.
22741
+ The \IndexCustom {\IsBottomTypeName}{isBottomType@\IsBottomTypeName}
22742
+ predicate is true if{}f the argument is a subtype of \code{Never}.
22726
22743
22727
22744
\begin{itemize}
22728
22745
\item \DefEquals{\IsBottomType{Never}}{\metavar{true}}.
@@ -22732,8 +22749,9 @@ \subsection{Functions Dealing with Extreme Types}
22732
22749
\end{itemize}
22733
22750
22734
22751
\noindent
22735
- The \Index{\IsNullTypeName} predicate is true if{}f
22736
- the argument is a subtype and a supertype of \code{Null}.
22752
+ The \IndexCustom{\IsNullTypeName}{isNullType@\IsNullTypeName}
22753
+ predicate is true if{}f the argument is
22754
+ a subtype and a supertype of \code{Null}.
22737
22755
22738
22756
\begin{itemize}
22739
22757
\item \DefEquals{\IsNullType{Null}}{\metavar{true}}.
@@ -22742,8 +22760,8 @@ \subsection{Functions Dealing with Extreme Types}
22742
22760
\end{itemize}
22743
22761
22744
22762
\noindent
22745
- The \Index {\IsMoreTopTypeName} predicate defines a total order on
22746
- top and \code{Object} types.
22763
+ The \IndexCustom {\IsMoreTopTypeName}{isMoreTopType@\IsMoreTopTypeName}
22764
+ predicate defines a total order on top and \code{Object} types.
22747
22765
22748
22766
\begin{itemize}
22749
22767
\item \DefEquals{\IsMoreTopType{\VOID}{$T$}}{\metavar{true}}.
@@ -22760,8 +22778,8 @@ \subsection{Functions Dealing with Extreme Types}
22760
22778
\end{itemize}
22761
22779
22762
22780
\noindent
22763
- The \Index {\IsMoreBottomTypeName} predicate defines an almost total order on
22764
- bottom and \code{Null} types.
22781
+ The \IndexCustom {\IsMoreBottomTypeName}{isMoreBottomType@\IsMoreBottomTypeName}
22782
+ predicate defines an almost total order on bottom and \code{Null} types.
22765
22783
\commentary{%
22766
22784
This does not consistently order
22767
22785
two different type variables with the same bound.%
@@ -22840,7 +22858,9 @@ \subsection{Type Normalization}
22840
22858
}
22841
22859
22842
22860
\LMHash{}%
22843
- The function \Index{\NormalizedTypeOfName} is then defined as follows:
22861
+ The function
22862
+ \IndexCustom{\NormalizedTypeOfName}{normalizedType@\NormalizedTypeOfName}
22863
+ is then defined as follows:
22844
22864
\BlindDefineSymbol{T_a, T_u, T_r}%
22845
22865
Let $T_a$ be a type
22846
22866
(\commentary{where `a' stands for `argument'}).
0 commit comments