Skip to content

Commit 47d2182

Browse files
committed
Extreme types, helper functions
1 parent 6588adb commit 47d2182

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
@@ -5440,7 +5440,12 @@ \subsection{Combined Member Signatures}
54405440

54415441
\LMHash{}%
54425442
Let \mall{} be the result of applying \TopMergeTypeName{} to
5443-
the elements in \Mall.
5443+
\NormalizedTypeOfName{} of the elements in \Mall.
5444+
\commentary{%
5445+
Note that these types are mutual subtypes,
5446+
and hence the normalized forms are structurally identical,
5447+
modulo different choices of top type in some locations.%
5448+
}
54445449
The combined member signature is then $m'$,
54455450
which is obtained from \mall{} by adding the modifier \COVARIANT{}
54465451
to each parameter $p$ (if it is not already present)
@@ -22289,6 +22294,8 @@ \subsection{Functions Dealing with Extreme Types}
2228922294
\LMHash{}%
2229022295
The functions are syntactic in nature such that termination is obvious.
2229122296
In particular, they do not rely on subtyping.
22297+
In each of these function definitions,
22298+
the first applicable case must be used.
2229222299

2229322300
\LMHash{}%
2229422301
The \Index{\TopMergeTypeName} of two types computes
@@ -22303,10 +22310,10 @@ \subsection{Functions Dealing with Extreme Types}
2230322310
\item \DefEquals{\TopMergeType{\VOID}{\VOID}}{\code{\VOID}}.
2230422311
\item \DefEquals{\TopMergeType{Object?}{\VOID}}{\code{Object?}}, and\\
2230522312
\DefEquals{\TopMergeType{\VOID}{Object?}}{\code{Object?}}.
22306-
\item \DefEquals{\TopMergeType{\DYNAMIC}{\VOID}}{\code{Object?}}, and\\
22307-
\DefEquals{\TopMergeType{\VOID}{\DYNAMIC}}{\code{Object?}}
2230822313
\item \DefEquals{\TopMergeType{Object?}{\DYNAMIC}}{\code{Object?}}, and\\
2230922314
\DefEquals{\TopMergeType{\DYNAMIC}{Object?}}{\code{Object?}}.
22315+
\item \DefEquals{\TopMergeType{\DYNAMIC}{\VOID}}{\code{Object?}}, and\\
22316+
\DefEquals{\TopMergeType{\VOID}{\DYNAMIC}}{\code{Object?}}
2231022317
\item \DefEquals{\TopMergeType{$T$?}{$S$?}}{\code{\TopMergeType{$T$}{$S$}?}}.
2231122318
\item For all other types, the function is applied recursively.
2231222319

@@ -22323,6 +22330,9 @@ \subsection{Functions Dealing with Extreme Types}
2232322330
Note that \TopMergeTypeName{} is not defined for
2232422331
types which are structurally different,
2232522332
apart from being or containing different top types.
22333+
When \TopMergeTypeName{} is used in this specification,
22334+
each case where \TopMergeTypeName{} is undefined
22335+
is handled explicitly.%
2232622336
}
2232722337

2232822338
\rationale{%
@@ -22333,7 +22343,10 @@ \subsection{Functions Dealing with Extreme Types}
2233322343
}
2233422344

2233522345
\commentary{%
22336-
For instance, if a class $C$ inherits a method $m$ that accepts
22346+
For instance, \TopMergeTypeName{} is used during the computation of
22347+
the interface of a class member which is declared
22348+
in multiple superinterfaces.
22349+
If a class $C$ inherits a method $m$ that accepts
2233722350
an argument of type \code{List<\DYNAMIC>} from one superinterface,
2233822351
and another method $m$ that accepts
2233922352
an argument of type \code{List<\VOID>}
@@ -22347,7 +22360,8 @@ \subsection{Functions Dealing with Extreme Types}
2234722360
\TopMergeTypeName{} of more than two types is defined by taking
2234822361
\TopMergeTypeName{} of the first two,
2234922362
and then recursively taking \TopMergeTypeName{} of the rest.
22350-
22363+
\commentary{The ordering of the arguments makes no difference.}
22364+
2235122365
\LMHash{}%
2235222366
The \Index{\IsTopTypeName} predicate is true for any type which is in
2235322367
the equivalence class of top types.
@@ -22362,7 +22376,7 @@ \subsection{Functions Dealing with Extreme Types}
2236222376
\item \DefEquals{\IsTopType{$T$}}{\metavar{false}}, otherwise.
2236322377
\end{itemize}
2236422378

22365-
\LMHash{}%
22379+
\noindent
2236622380
The \Index{\IsObjectTypeName} predicate is true if{}f
2236722381
the argument is a subtype and a supertype of \code{Object}.
2236822382

@@ -22372,7 +22386,7 @@ \subsection{Functions Dealing with Extreme Types}
2237222386
\item \DefEquals{\IsObjectType{$T$}}{\metavar{false}}, otherwise.
2237322387
\end{itemize}
2237422388

22375-
\LMHash{}%
22389+
\noindent
2237622390
The \Index{\IsBottomTypeName} predicate is true if{}f
2237722391
the argument is a subtype of \code{Never}.
2237822392

@@ -22383,7 +22397,7 @@ \subsection{Functions Dealing with Extreme Types}
2238322397
\item \DefEquals{\IsBottomType{$T$}}{\metavar{false}}, otherwise.
2238422398
\end{itemize}
2238522399

22386-
\LMHash{}%
22400+
\noindent
2238722401
The \Index{\IsNullTypeName} predicate is true if{}f
2238822402
the argument is a subtype and a supertype of \code{Null}.
2238922403

@@ -22393,7 +22407,7 @@ \subsection{Functions Dealing with Extreme Types}
2239322407
\item \DefEquals{\IsNullType{$T$}}{\metavar{false}}, otherwise.
2239422408
\end{itemize}
2239522409

22396-
\LMHash{}%
22410+
\noindent
2239722411
The \Index{\IsMoreTopTypeName} predicate defines a total order on
2239822412
top and \code{Object} types.
2239922413

@@ -22411,7 +22425,7 @@ \subsection{Functions Dealing with Extreme Types}
2241122425
\IsMoreTopType{$T$}{$S$}}.
2241222426
\end{itemize}
2241322427

22414-
\LMHash{}%
22428+
\noindent
2241522429
The \Index{\IsMoreBottomTypeName} predicate defines an almost total order on
2241622430
bottom and \code{Null} types.
2241722431
\commentary{%
@@ -22436,8 +22450,6 @@ \subsection{Functions Dealing with Extreme Types}
2243622450
\IsMoreBottomType{$T$}{$S$}}.
2243722451
\end{itemize}
2243822452

22439-
!!!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.
22440-
2244122453

2244222454
\subsection{Type Normalization}
2244322455
\LMLabel{typeNormalization}

0 commit comments

Comments
 (0)