Skip to content

Specify that 'await voidExpression' is allowed #846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions specification/dartLangSpec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
% it does not have the required signature.
% - Clarify static checks on `yield` and `yield*` to explicitly ensure that
% assignability is enforced per element.
% - Update whitelist for expressions of type void to include `await e`,
% consistent with decision in SDK issue #33415.
%
% 2.6
% - Specify static analysis of a "callable object" invocation (where
Expand Down Expand Up @@ -18223,6 +18225,14 @@ \subsection{Type Void}
The static type of the null coalescing expression is then \VOID,
which in turn restricts where it can occur.%
}
\item
In an expression of the form \code{\AWAIT\,\,$e$}, $e$ may have type \VOID.
\rationale{%
This rule was adopted because it was a substantial breaking change
to turn this situation into an error
at the time where the treatment of \VOID{} was changed.
Tools may choose to give a hint in such cases.%
}
\item
\commentary{%
In a return statement \code{\RETURN\,$e$;},
Expand Down