mirror of
https://github.com/dart-lang/sdk
synced 2024-10-03 00:29:50 +00:00
f7d5d0cfbe
In the front end, type inference of an expression always takes place with respect to a type schema (the "context"). In the analyzer, type inference of an expression sometimes takes place with respect to a context, but sometimes takes place with respect to no context at all; the latter circumstance arises when the analyzer uses its standard AstVisitor mechanism to call one of the visit methods in the ResolverVisitor class, and so the visit method's contextType argument takes on the value null. Because of this I am calling this situation a "null context". In all the circumstances where the analyzer infers an expression using a null context, the front end infers the same expression using a context of _. Furthermore, prior to this change, all but one of the analyzer's visit methods treated a null context the same as they treated a context of _. The one exception was visitAwaitExpression: in this method, if the context was the null context, then the analyzer analyzed the await expression's subexpression using a context of _; otherwise, it analyzed it using a context of FutureOr<_>. Whereas the front end, lacking any notion of a "null context", analyzes the await expression's subexpression using a context of FutureOr<_> in the same circumstances. This change brings the analyzer behavior into line with the front end. Fixes https://github.com/dart-lang/language/issues/3648. Bug: https://github.com/dart-lang/language/issues/3648 Change-Id: Ifd77988010d4387ce48eaa20dff4356beec03753 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357521 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Paul Berry <paulberry@google.com> |
||
---|---|---|
.. | ||
co19 | ||
corelib | ||
dartdevc | ||
ffi | ||
hot_reload | ||
language | ||
lib | ||
macro_build | ||
modular | ||
standalone | ||
web | ||
legacy_status_dart2js.csv | ||
OWNERS | ||
README.md |
This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/wiki/Testing.