Skip to content

Commit 0939714

Browse files
committed
Extreme types, helper functions
1 parent 93ebc11 commit 0939714

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

53945394
\LMHash{}%
53955395
Let \mall{} be the result of applying \TopMergeTypeName{} to
5396-
the elements in \Mall.
5396+
\NormalizedTypeOfName{} of the elements in \Mall.
5397+
\commentary{%
5398+
Note that these types are mutual subtypes,
5399+
and hence the normalized forms are structurally identical,
5400+
modulo different choices of top type in some locations.%
5401+
}
53975402
The combined member signature is then $m'$,
53985403
which is obtained from \mall{} by adding the modifier \COVARIANT{}
53995404
to each parameter $p$ (if it is not already present)
@@ -22024,6 +22029,8 @@ \subsection{Functions Dealing with Extreme Types}
2202422029
\LMHash{}%
2202522030
The functions are syntactic in nature such that termination is obvious.
2202622031
In particular, they do not rely on subtyping.
22032+
In each of these function definitions,
22033+
the first applicable case must be used.
2202722034

2202822035
\LMHash{}%
2202922036
The \Index{\TopMergeTypeName} of two types computes
@@ -22038,10 +22045,10 @@ \subsection{Functions Dealing with Extreme Types}
2203822045
\item \DefEquals{\TopMergeType{\VOID}{\VOID}}{\code{\VOID}}.
2203922046
\item \DefEquals{\TopMergeType{Object?}{\VOID}}{\code{Object?}}, and\\
2204022047
\DefEquals{\TopMergeType{\VOID}{Object?}}{\code{Object?}}.
22041-
\item \DefEquals{\TopMergeType{\DYNAMIC}{\VOID}}{\code{Object?}}, and\\
22042-
\DefEquals{\TopMergeType{\VOID}{\DYNAMIC}}{\code{Object?}}
2204322048
\item \DefEquals{\TopMergeType{Object?}{\DYNAMIC}}{\code{Object?}}, and\\
2204422049
\DefEquals{\TopMergeType{\DYNAMIC}{Object?}}{\code{Object?}}.
22050+
\item \DefEquals{\TopMergeType{\DYNAMIC}{\VOID}}{\code{Object?}}, and\\
22051+
\DefEquals{\TopMergeType{\VOID}{\DYNAMIC}}{\code{Object?}}
2204522052
\item \DefEquals{\TopMergeType{$T$?}{$S$?}}{\code{\TopMergeType{$T$}{$S$}?}}.
2204622053
\item For all other types, the function is applied recursively.
2204722054

@@ -22058,6 +22065,9 @@ \subsection{Functions Dealing with Extreme Types}
2205822065
Note that \TopMergeTypeName{} is not defined for
2205922066
types which are structurally different,
2206022067
apart from being or containing different top types.
22068+
When \TopMergeTypeName{} is used in this specification,
22069+
each case where \TopMergeTypeName{} is undefined
22070+
is handled explicitly.%
2206122071
}
2206222072

2206322073
\rationale{%
@@ -22068,7 +22078,10 @@ \subsection{Functions Dealing with Extreme Types}
2206822078
}
2206922079

2207022080
\commentary{%
22071-
For instance, if a class $C$ inherits a method $m$ that accepts
22081+
For instance, \TopMergeTypeName{} is used during the computation of
22082+
the interface of a class member which is declared
22083+
in multiple superinterfaces.
22084+
If a class $C$ inherits a method $m$ that accepts
2207222085
an argument of type \code{List<\DYNAMIC>} from one superinterface,
2207322086
and another method $m$ that accepts
2207422087
an argument of type \code{List<\VOID>}
@@ -22082,7 +22095,8 @@ \subsection{Functions Dealing with Extreme Types}
2208222095
\TopMergeTypeName{} of more than two types is defined by taking
2208322096
\TopMergeTypeName{} of the first two,
2208422097
and then recursively taking \TopMergeTypeName{} of the rest.
22085-
22098+
\commentary{The ordering of the arguments makes no difference.}
22099+
2208622100
\LMHash{}%
2208722101
The \Index{\IsTopTypeName} predicate is true for any type which is in
2208822102
the equivalence class of top types.
@@ -22097,7 +22111,7 @@ \subsection{Functions Dealing with Extreme Types}
2209722111
\item \DefEquals{\IsTopType{$T$}}{\metavar{false}}, otherwise.
2209822112
\end{itemize}
2209922113

22100-
\LMHash{}%
22114+
\noindent
2210122115
The \Index{\IsObjectTypeName} predicate is true if{}f
2210222116
the argument is a subtype and a supertype of \code{Object}.
2210322117

@@ -22107,7 +22121,7 @@ \subsection{Functions Dealing with Extreme Types}
2210722121
\item \DefEquals{\IsObjectType{$T$}}{\metavar{false}}, otherwise.
2210822122
\end{itemize}
2210922123

22110-
\LMHash{}%
22124+
\noindent
2211122125
The \Index{\IsBottomTypeName} predicate is true if{}f
2211222126
the argument is a subtype of \code{Never}.
2211322127

@@ -22118,7 +22132,7 @@ \subsection{Functions Dealing with Extreme Types}
2211822132
\item \DefEquals{\IsBottomType{$T$}}{\metavar{false}}, otherwise.
2211922133
\end{itemize}
2212022134

22121-
\LMHash{}%
22135+
\noindent
2212222136
The \Index{\IsNullTypeName} predicate is true if{}f
2212322137
the argument is a subtype and a supertype of \code{Null}.
2212422138

@@ -22128,7 +22142,7 @@ \subsection{Functions Dealing with Extreme Types}
2212822142
\item \DefEquals{\IsNullType{$T$}}{\metavar{false}}, otherwise.
2212922143
\end{itemize}
2213022144

22131-
\LMHash{}%
22145+
\noindent
2213222146
The \Index{\IsMoreTopTypeName} predicate defines a total order on
2213322147
top and \code{Object} types.
2213422148

@@ -22146,7 +22160,7 @@ \subsection{Functions Dealing with Extreme Types}
2214622160
\IsMoreTopType{$T$}{$S$}}.
2214722161
\end{itemize}
2214822162

22149-
\LMHash{}%
22163+
\noindent
2215022164
The \Index{\IsMoreBottomTypeName} predicate defines an almost total order on
2215122165
bottom and \code{Null} types.
2215222166
\commentary{%
@@ -22171,8 +22185,6 @@ \subsection{Functions Dealing with Extreme Types}
2217122185
\IsMoreBottomType{$T$}{$S$}}.
2217222186
\end{itemize}
2217322187

22174-
!!!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.
22175-
2217622188

2217722189
\subsection{Type Normalization}
2217822190
\LMLabel{typeNormalization}

0 commit comments

Comments
 (0)