Skip to content

Commit b01a798

Browse files
committed
Extreme types, helper functions
1 parent b63356a commit b01a798

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

54335433
\LMHash{}%
54345434
Let \mall{} be the result of applying \TopMergeTypeName{} to
5435-
the elements in \Mall.
5435+
\NormalizedTypeOfName{} of the elements in \Mall.
5436+
\commentary{%
5437+
Note that these types are mutual subtypes,
5438+
and hence the normalized forms are structurally identical,
5439+
modulo different choices of top type in some locations.%
5440+
}
54365441
The combined member signature is then $m'$,
54375442
which is obtained from \mall{} by adding the modifier \COVARIANT{}
54385443
to each parameter $p$ (if it is not already present)
@@ -22152,6 +22157,8 @@ \subsection{Functions Dealing with Extreme Types}
2215222157
\LMHash{}%
2215322158
The functions are syntactic in nature such that termination is obvious.
2215422159
In particular, they do not rely on subtyping.
22160+
In each of these function definitions,
22161+
the first applicable case must be used.
2215522162

2215622163
\LMHash{}%
2215722164
The \Index{\TopMergeTypeName} of two types computes
@@ -22166,10 +22173,10 @@ \subsection{Functions Dealing with Extreme Types}
2216622173
\item \DefEquals{\TopMergeType{\VOID}{\VOID}}{\code{\VOID}}.
2216722174
\item \DefEquals{\TopMergeType{Object?}{\VOID}}{\code{Object?}}, and\\
2216822175
\DefEquals{\TopMergeType{\VOID}{Object?}}{\code{Object?}}.
22169-
\item \DefEquals{\TopMergeType{\DYNAMIC}{\VOID}}{\code{Object?}}, and\\
22170-
\DefEquals{\TopMergeType{\VOID}{\DYNAMIC}}{\code{Object?}}
2217122176
\item \DefEquals{\TopMergeType{Object?}{\DYNAMIC}}{\code{Object?}}, and\\
2217222177
\DefEquals{\TopMergeType{\DYNAMIC}{Object?}}{\code{Object?}}.
22178+
\item \DefEquals{\TopMergeType{\DYNAMIC}{\VOID}}{\code{Object?}}, and\\
22179+
\DefEquals{\TopMergeType{\VOID}{\DYNAMIC}}{\code{Object?}}
2217322180
\item \DefEquals{\TopMergeType{$T$?}{$S$?}}{\code{\TopMergeType{$T$}{$S$}?}}.
2217422181
\item For all other types, the function is applied recursively.
2217522182

@@ -22186,6 +22193,9 @@ \subsection{Functions Dealing with Extreme Types}
2218622193
Note that \TopMergeTypeName{} is not defined for
2218722194
types which are structurally different,
2218822195
apart from being or containing different top types.
22196+
When \TopMergeTypeName{} is used in this specification,
22197+
each case where \TopMergeTypeName{} is undefined
22198+
is handled explicitly.%
2218922199
}
2219022200

2219122201
\rationale{%
@@ -22196,7 +22206,10 @@ \subsection{Functions Dealing with Extreme Types}
2219622206
}
2219722207

2219822208
\commentary{%
22199-
For instance, if a class $C$ inherits a method $m$ that accepts
22209+
For instance, \TopMergeTypeName{} is used during the computation of
22210+
the interface of a class member which is declared
22211+
in multiple superinterfaces.
22212+
If a class $C$ inherits a method $m$ that accepts
2220022213
an argument of type \code{List<\DYNAMIC>} from one superinterface,
2220122214
and another method $m$ that accepts
2220222215
an argument of type \code{List<\VOID>}
@@ -22210,7 +22223,8 @@ \subsection{Functions Dealing with Extreme Types}
2221022223
\TopMergeTypeName{} of more than two types is defined by taking
2221122224
\TopMergeTypeName{} of the first two,
2221222225
and then recursively taking \TopMergeTypeName{} of the rest.
22213-
22226+
\commentary{The ordering of the arguments makes no difference.}
22227+
2221422228
\LMHash{}%
2221522229
The \Index{\IsTopTypeName} predicate is true for any type which is in
2221622230
the equivalence class of top types.
@@ -22225,7 +22239,7 @@ \subsection{Functions Dealing with Extreme Types}
2222522239
\item \DefEquals{\IsTopType{$T$}}{\metavar{false}}, otherwise.
2222622240
\end{itemize}
2222722241

22228-
\LMHash{}%
22242+
\noindent
2222922243
The \Index{\IsObjectTypeName} predicate is true if{}f
2223022244
the argument is a subtype and a supertype of \code{Object}.
2223122245

@@ -22235,7 +22249,7 @@ \subsection{Functions Dealing with Extreme Types}
2223522249
\item \DefEquals{\IsObjectType{$T$}}{\metavar{false}}, otherwise.
2223622250
\end{itemize}
2223722251

22238-
\LMHash{}%
22252+
\noindent
2223922253
The \Index{\IsBottomTypeName} predicate is true if{}f
2224022254
the argument is a subtype of \code{Never}.
2224122255

@@ -22246,7 +22260,7 @@ \subsection{Functions Dealing with Extreme Types}
2224622260
\item \DefEquals{\IsBottomType{$T$}}{\metavar{false}}, otherwise.
2224722261
\end{itemize}
2224822262

22249-
\LMHash{}%
22263+
\noindent
2225022264
The \Index{\IsNullTypeName} predicate is true if{}f
2225122265
the argument is a subtype and a supertype of \code{Null}.
2225222266

@@ -22256,7 +22270,7 @@ \subsection{Functions Dealing with Extreme Types}
2225622270
\item \DefEquals{\IsNullType{$T$}}{\metavar{false}}, otherwise.
2225722271
\end{itemize}
2225822272

22259-
\LMHash{}%
22273+
\noindent
2226022274
The \Index{\IsMoreTopTypeName} predicate defines a total order on
2226122275
top and \code{Object} types.
2226222276

@@ -22274,7 +22288,7 @@ \subsection{Functions Dealing with Extreme Types}
2227422288
\IsMoreTopType{$T$}{$S$}}.
2227522289
\end{itemize}
2227622290

22277-
\LMHash{}%
22291+
\noindent
2227822292
The \Index{\IsMoreBottomTypeName} predicate defines an almost total order on
2227922293
bottom and \code{Null} types.
2228022294
\commentary{%
@@ -22299,8 +22313,6 @@ \subsection{Functions Dealing with Extreme Types}
2229922313
\IsMoreBottomType{$T$}{$S$}}.
2230022314
\end{itemize}
2230122315

22302-
!!!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.
22303-
2230422316

2230522317
\subsection{Type Normalization}
2230622318
\LMLabel{typeNormalization}

0 commit comments

Comments
 (0)