Skip to content

Commit cdc0359

Browse files
committed
Specify erasure of intersection types for the semantics of await expressions
1 parent 010c13b commit cdc0359

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

specification/dartLangSpec.tex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17111,8 +17111,12 @@ \subsection{Await Expressions}
1711117111

1711217112
\LMHash{}%
1711317113
Evaluation of an await expression $a$ of the form \code{\AWAIT{} $e$}
17114-
where $e$ has static type $S$ proceeds as follows:
17114+
where $e$ has static type $S_0$ proceeds as follows:
1711517115
First, the expression $e$ is evaluated to an object $o$.
17116+
If $S_0$ is of the form \code{$X$\,\,\&\,\,$S_1$}
17117+
(\ref{intersectionTypes})
17118+
then let $S$ be $X$.
17119+
Otherwise, let $S$ be $S_0$.
1711617120
Let $T$ be \Flatten{$S$}
1711717121
(\ref{functionExpressions}).
1711817122
It is a dynamic type error if the run-time type of $o$ is not a subtype
@@ -26039,7 +26043,7 @@ \section*{Appendix: Algorithmic Subtyping}
2603926043
if $T_0$ is a type variable $X_0$
2604026044
or a promoted type variables \code{$X_0$\,\&\,$S_0$} and $T_1$ is $X_0$
2604126045
then \SubtypeNE{T_0}{T_1}.
26042-
26046+
2604326047
\commentary{%
2604426048
Note that this rule is admissible, and can be safely elided if desired.%
2604526049
}

0 commit comments

Comments
 (0)