Skip to content

Commit

Permalink
Enhance the definition of "derives a future type"
Browse files Browse the repository at this point in the history
  • Loading branch information
eernstg committed Jan 18, 2024
1 parent e433c0c commit f79a2ab
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions specification/dartLangSpec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11721,13 +11721,36 @@ \subsection{Function Expressions}
$T$ in the following cases, using the first applicable case:

\begin{itemize}
\item $T$ implements $S$
(\ref{interfaceSuperinterfaces}),
and there is a $U$ such that $S$ is \code{Future<$U$>}.
\item $T$ is $S$ bounded
\item
If $T$ implements \code{Future<$U$>}
(\ref{interfaceSuperinterfaces})
for some $U$ then
$T$ derives the future type \code{Future<$U$>}.
\item
Whenever $S$ is of the form
\code{FutureOr<$U$>}, \code{Future<$U$>?}, or \code{FutureOr<$U$>?},
the following holds:
If $T$ is $S$ bounded
(\ref{bindingActualsToFormals}),
and there is a $U$ such that
$S$ is \code{FutureOr<$U$>}, \code{Future<$U$>?}, or \code{FutureOr<$U$>?}.
then $T$ derives the future type $S$.
\item
If $T$ is \code{$T_1$?} for some $T_1$ and
$T_1$ derives the future type $S_1$
then $T$ derives the future type \code{$S_1$?}.
\item
If $T$ is a type variable with bound $B$ and
$B$ derives the future type $S$
then $T$ derives the future type $S$.
\item
If $T$ is of the form \code{$X$\,\,\&\,\,$B$} then the following holds:
\begin{itemize}
\item
if $B$ derives the future type $S$ then $T$ derives $S$.
\item
if $B$ does not derive a future type,
but $X$ derives the future type $S$
then $T$ derives $S$.
\end{itemize}
\end{itemize}

\LMHash{}%
Expand Down

0 comments on commit f79a2ab

Please sign in to comment.