dart-sdk/tests
Paul Berry f7d5d0cfbe Remove special analyzer behavior for await expressions with "null context".
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>
2024-03-20 17:33:28 +00:00
..
co19 [dart2wasm] New async* desugaring 2024-03-05 11:56:00 +00:00
corelib [tests] Remove debug prints from corelib/date_time7 test 2024-03-19 12:30:56 +00:00
dartdevc [ddc] Delete variance tests for old DDC types 2024-02-14 22:29:33 +00:00
ffi [vm/test] Fix imports 2024-03-15 17:21:30 +00:00
hot_reload [ddc] Creating a hot reload and hot restart test suite. 2024-03-05 00:12:18 +00:00
language Remove special analyzer behavior for await expressions with "null context". 2024-03-20 17:33:28 +00:00
lib [dart:js_interop] Better error reporting for invalid external types 2024-03-15 23:36:22 +00:00
macro_build [macros] Tweaks to macro_build test. 2024-03-12 12:46:19 +00:00
modular [tests] Add repro for cross module constant 2023-11-13 22:21:40 +00:00
standalone [vm/io] Cleanup long path handling on Windows 2024-03-12 08:29:36 +00:00
web [dart2wasm] Add --delete-tostring-package-uri option to dart2wasm 2024-03-06 15:55:31 +00:00
legacy_status_dart2js.csv Spelling tests 2022-12-19 12:56:47 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
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.