@@ -20919,7 +20919,8 @@ \section{Types}
2091920919\LMLabel{types}
2092020920
2092120921\LMHash{}%
20922- Dart supports static typing based on interface types.
20922+ Dart supports static typing based on interface types
20923+ (\ref{interfaceTypes}).
2092320924
2092420925\rationale{%
2092520926The type system is sound in the sense that
@@ -21726,8 +21727,7 @@ \subsection{Subtypes}
2172621727 T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
2172721728 % ------------------------------------------------ Right Object
2172821729 \RuleRaw{\SrnRightObjectFour}{%
21729- \mbox{$S$ is an interface type,}\\
21730- \mbox{a function type, or \FUNCTION}}{S}{\code{Object}}
21730+ \mbox{$S$ is an interface type or \FUNCTION}}{S}{\code{Object}}
2173121731 % ------------------------------------------------ Left Null 2
2173221732 \Rule{\SrnNullTwo}{\code{Null}}{T}{%
2173321733 \code{Null}}{\code{FutureOr<$T$>}}
@@ -22102,8 +22102,7 @@ \subsubsection{Informal Subtype Rule Descriptions}
2210222102\Item{\SrnBottom}{Bottom}
2210322103 \code{Never} is a subtype of every type.
2210422104\Item{\SrnRightObjectFour}{Right Object}
22105- Interface types, function types, and \FUNCTION{}
22106- are subtypes of \code{Object}.
22105+ Interface types and \FUNCTION{} are subtypes of \code{Object}.
2210722106\Item{\SrnNullOne}{Null Nullable}
2210822107 \code{Null} is a subtype of every type of the form \code{$T$?}.
2210922108\Item{\SrnNullTwo}{Null FutureOr}
@@ -22291,7 +22290,7 @@ \subsection{Type Nullability}
2229122290\item \code{Never}.
2229222291\item Any function type.
2229322292\item The type \FUNCTION.
22294- \item Any interface type except \code{Null} .
22293+ \item Any interface type.
2229522294\item \code{FutureOr<$S$>}, for any non-nullable type $S$.
2229622295\item Any type variable $X$ whose bound is non-nullable.
2229722296\item Any type of the form \code{$X$\,\&\,$S$}, where
@@ -23610,15 +23609,13 @@ \subsubsection{The Standard Upper Bound of Distinct Interface Types}
2361023609
2361123610\LMHash{}%
2361223611We define the auxiliary function \NominalTypeDepthName{}
23613- on interface types and \code{Object?} as follows:
23612+ on interface types as follows:
2361423613
2361523614\begin{itemize}
2361623615\item
23617- \DefEquals{\NominalTypeDepth{Object?}}{0}.
23618- \item
23619- \DefEquals{\NominalTypeDepth{Object}}{1}.
23620- \item
23621- \DefEquals{\NominalTypeDepth{Null}}{1}.
23616+ % We could make it 1 rather than 0, to "reserve space" for `Object?`,
23617+ % but this function is never used with `Object?` anyway.
23618+ \DefEquals{\NominalTypeDepth{Object}}{0}.
2362223619\item
2362323620 Let $T$ be a class or a mixin,
2362423621 and let $M$ be the set of immediate superinterfaces of $T$.
@@ -23627,10 +23624,6 @@ \subsubsection{The Standard Upper Bound of Distinct Interface Types}
2362723624 $\metavar{max}\,\{\;\NominalTypeDepth{$S$}\;|\;S\;\in M\;\}$.
2362823625\end{itemize}
2362923626
23630- \commentary{%
23631-
23632- }
23633-
2363423627\LMHash{}%
2363523628\BlindDefineSymbol{I, J, M}%
2363623629The algorithm that determines
@@ -24019,21 +24012,22 @@ \subsection{Interface Types}
2401924012(\ref{typedef}).
2402024013We say that $T$ is an \Index{interface type} if{}f
2402124014$T'$ is of the form \code{$C$<\List{T}{1}{k}>},
24022- where $C$ denotes a class different from \code{Never},
24015+ where $C$ denotes a class different from \code{Never} and \code{Null} ,
2402324016or $C$ denotes a mixin.
2402424017
2402524018\commentary{%
2402624019Note that \List{T}{1}{k} can be arbitrary types.
2402724020Non-generic classes are included because we can have $k = 0$.
2402824021
2402924022In particular, the following types are \emph{not} interface types:
24030- \VOID, \DYNAMIC, \FUNCTION, \code{FutureOr<$T$>} for any $T$, \code{Never},
24023+ \VOID, \DYNAMIC, \FUNCTION, \code{FutureOr<$T$>} for any $T$,
24024+ \code{Never}, \code{Null},
2403124025any function type, any type variable, any intersection type,
2403224026and any type of the form \code{$T$?}.
2403324027
24034- Conversely, built-in classes
24035- like \code{Object}, \code{Null }, \code{num }, \code{int},
24036- \code{String}, and \code{Exception} are interface types,
24028+ Conversely, built-in classes like, e.g.,
24029+ \code{Object}, \code{num }, \code{int }, \code{String}, and \code{Exception}
24030+ are interface types,
2403724031and so are
2403824032\code{Future<$T$>}, \code{Stream<$T$>}, \code{Iterable<$T$>},
2403924033\code{List<$T$>}, \code{Map<$S$,\,\,$T$}, and \code{Set<$T$>},
0 commit comments