Skip to content

Commit 441b377

Browse files
committed
Extreme types, helper functions
1 parent f1d2b06 commit 441b377

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

specification/dartLangSpec.tex

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5618,7 +5618,12 @@ \subsection{Combined Member Signatures}
56185618

56195619
\LMHash{}%
56205620
Let \mall{} be the result of applying \TopMergeTypeName{} to
5621-
the elements in \Mall.
5621+
\NormalizedTypeOfName{} of the elements in \Mall.
5622+
\commentary{%
5623+
Note that these types are mutual subtypes,
5624+
and hence the normalized forms are structurally identical,
5625+
modulo different choices of top type in some locations.%
5626+
}
56225627
The combined member signature is then $m'$,
56235628
which is obtained from \mall{} by adding the modifier \COVARIANT{}
56245629
to each parameter $p$ (if it is not already present)
@@ -22527,6 +22532,8 @@ \subsection{Functions Dealing with Extreme Types}
2252722532
\LMHash{}%
2252822533
The functions are syntactic in nature such that termination is obvious.
2252922534
In particular, they do not rely on subtyping.
22535+
In each of these function definitions,
22536+
the first applicable case must be used.
2253022537

2253122538
\LMHash{}%
2253222539
The \Index{\TopMergeTypeName} of two types computes
@@ -22541,10 +22548,10 @@ \subsection{Functions Dealing with Extreme Types}
2254122548
\item \DefEquals{\TopMergeType{\VOID}{\VOID}}{\code{\VOID}}.
2254222549
\item \DefEquals{\TopMergeType{Object?}{\VOID}}{\code{Object?}}, and\\
2254322550
\DefEquals{\TopMergeType{\VOID}{Object?}}{\code{Object?}}.
22544-
\item \DefEquals{\TopMergeType{\DYNAMIC}{\VOID}}{\code{Object?}}, and\\
22545-
\DefEquals{\TopMergeType{\VOID}{\DYNAMIC}}{\code{Object?}}
2254622551
\item \DefEquals{\TopMergeType{Object?}{\DYNAMIC}}{\code{Object?}}, and\\
2254722552
\DefEquals{\TopMergeType{\DYNAMIC}{Object?}}{\code{Object?}}.
22553+
\item \DefEquals{\TopMergeType{\DYNAMIC}{\VOID}}{\code{Object?}}, and\\
22554+
\DefEquals{\TopMergeType{\VOID}{\DYNAMIC}}{\code{Object?}}
2254822555
\item \DefEquals{\TopMergeType{$T$?}{$S$?}}{\code{\TopMergeType{$T$}{$S$}?}}.
2254922556
\item For all other types, the function is applied recursively.
2255022557

@@ -22561,6 +22568,9 @@ \subsection{Functions Dealing with Extreme Types}
2256122568
Note that \TopMergeTypeName{} is not defined for
2256222569
types which are structurally different,
2256322570
apart from being or containing different top types.
22571+
When \TopMergeTypeName{} is used in this specification,
22572+
each case where \TopMergeTypeName{} is undefined
22573+
is handled explicitly.%
2256422574
}
2256522575

2256622576
\rationale{%
@@ -22571,7 +22581,10 @@ \subsection{Functions Dealing with Extreme Types}
2257122581
}
2257222582

2257322583
\commentary{%
22574-
For instance, if a class $C$ inherits a method $m$ that accepts
22584+
For instance, \TopMergeTypeName{} is used during the computation of
22585+
the interface of a class member which is declared
22586+
in multiple superinterfaces.
22587+
If a class $C$ inherits a method $m$ that accepts
2257522588
an argument of type \code{List<\DYNAMIC>} from one superinterface,
2257622589
and another method $m$ that accepts
2257722590
an argument of type \code{List<\VOID>}
@@ -22585,7 +22598,8 @@ \subsection{Functions Dealing with Extreme Types}
2258522598
\TopMergeTypeName{} of more than two types is defined by taking
2258622599
\TopMergeTypeName{} of the first two,
2258722600
and then recursively taking \TopMergeTypeName{} of the rest.
22588-
22601+
\commentary{The ordering of the arguments makes no difference.}
22602+
2258922603
\LMHash{}%
2259022604
The \Index{\IsTopTypeName} predicate is true for any type which is in
2259122605
the equivalence class of top types.
@@ -22600,7 +22614,7 @@ \subsection{Functions Dealing with Extreme Types}
2260022614
\item \DefEquals{\IsTopType{$T$}}{\metavar{false}}, otherwise.
2260122615
\end{itemize}
2260222616

22603-
\LMHash{}%
22617+
\noindent
2260422618
The \Index{\IsObjectTypeName} predicate is true if{}f
2260522619
the argument is a subtype and a supertype of \code{Object}.
2260622620

@@ -22610,7 +22624,7 @@ \subsection{Functions Dealing with Extreme Types}
2261022624
\item \DefEquals{\IsObjectType{$T$}}{\metavar{false}}, otherwise.
2261122625
\end{itemize}
2261222626

22613-
\LMHash{}%
22627+
\noindent
2261422628
The \Index{\IsBottomTypeName} predicate is true if{}f
2261522629
the argument is a subtype of \code{Never}.
2261622630

@@ -22621,7 +22635,7 @@ \subsection{Functions Dealing with Extreme Types}
2262122635
\item \DefEquals{\IsBottomType{$T$}}{\metavar{false}}, otherwise.
2262222636
\end{itemize}
2262322637

22624-
\LMHash{}%
22638+
\noindent
2262522639
The \Index{\IsNullTypeName} predicate is true if{}f
2262622640
the argument is a subtype and a supertype of \code{Null}.
2262722641

@@ -22631,7 +22645,7 @@ \subsection{Functions Dealing with Extreme Types}
2263122645
\item \DefEquals{\IsNullType{$T$}}{\metavar{false}}, otherwise.
2263222646
\end{itemize}
2263322647

22634-
\LMHash{}%
22648+
\noindent
2263522649
The \Index{\IsMoreTopTypeName} predicate defines a total order on
2263622650
top and \code{Object} types.
2263722651

@@ -22649,7 +22663,7 @@ \subsection{Functions Dealing with Extreme Types}
2264922663
\IsMoreTopType{$T$}{$S$}}.
2265022664
\end{itemize}
2265122665

22652-
\LMHash{}%
22666+
\noindent
2265322667
The \Index{\IsMoreBottomTypeName} predicate defines an almost total order on
2265422668
bottom and \code{Null} types.
2265522669
\commentary{%
@@ -22674,8 +22688,6 @@ \subsection{Functions Dealing with Extreme Types}
2267422688
\IsMoreBottomType{$T$}{$S$}}.
2267522689
\end{itemize}
2267622690

22677-
!!!TODO!!! Clean up this section: We should say that these definitions are used in order (first applicable case must be used). We should specify the acceptable arguments is each case, and argue that we're never calling them on anything which is not acceptable.
22678-
2267922691

2268022692
\subsection{Type Normalization}
2268122693
\LMLabel{typeNormalization}

0 commit comments

Comments
 (0)