dart-sdk/tests
Paul Berry 0d636e5543 Ensure that partial inference results aren't refined by later partial inference stages.
As part of the implementation of
https://github.com/dart-lang/language/issues/731 (improved inference
for fold etc.), I expanded the front end's type inference logic so
that instead of just having a downward phase and an upward phase, it
could have 3 or more phases.  The function that previously did
downward inference became repurposed to do "partial inference" (which
could either be the first, downward stage, or a later, horizontal
stage).  However, I failed to generalize the logic that prevents types
assigned by one inference stage from being refined by later
stages--previously this logic was only needed for upward inference,
but now it's needed for horizontal inference stages as well.  (This
logic is needed because of Dart's "runtime checked covariance"
behavior--it means that we want to stick with the type from downward
inference, even if a later horizontal inference stage is able to find
a more precise type, because that more precise type may lead to
runtime failures).

As part of this change I've re-architected the inference methods so
that they are responsible for creating and returning the list of
inferred types.  This makes the inference logic more similar between
the front end and analyzer, and is easier to read IMHO.  The total
number of list allocations is the same as before.

Change-Id: I19bfcede9c2968e50f110b571164549f16495217
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243707
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-05-10 15:10:44 +00:00
..
co19 Skip co19/LanguageFeatures/Enhanced-Enum/grammar_A07_t01 on the web 2022-04-05 19:54:13 +00:00
co19_2 [infra] Stop manually creating co19 cipd packages. 2022-03-28 14:01:37 +00:00
corelib Fix bug in Duration.toString. 2022-04-25 14:37:42 +00:00
corelib_2 Fix bug in Duration.toString. 2022-04-25 14:37:42 +00:00
dartdevc [ddc] Avoid emitting dead branches in conditionals 2022-05-03 20:17:44 +00:00
dartdevc_2 [vm] Expose whether extension stream has listeners, guard postEvent 2022-04-26 07:53:43 +00:00
ffi [vm/ffi] Add Char C type 2022-03-28 09:46:56 +00:00
ffi_2 [vm/ffi] Add Char C type 2022-03-28 09:46:56 +00:00
language Ensure that partial inference results aren't refined by later partial inference stages. 2022-05-10 15:10:44 +00:00
language_2 [vm] New async/await implementation in the VM, part 2 - vm 2022-04-29 01:03:50 +00:00
lib [vm/simd] Add Float64x2 clamp simd implementation 2022-05-10 04:56:25 +00:00
lib_2 [vm/simd] Add Float64x2 clamp simd implementation 2022-05-10 04:56:25 +00:00
modular [dart2js] Fix bug in impact data serialization. 2022-05-10 03:34:13 +00:00
standalone Remove trailing null char from IOOverrides.fseGetType 2022-05-02 21:16:20 +00:00
standalone_2 Remove trailing null char from IOOverrides.fseGetType 2022-05-02 21:16:20 +00:00
web [dart2js] Fix bug in constant impact visitor. 2022-04-25 18:51:37 +00:00
web_2 [dart2js] Fix deferred load URI when baseUrl has a single path segment 2022-04-22 21:33:10 +00:00
legacy_status_dart2js.csv [dart2js] Remove obsolete unittests. 2020-05-12 17:16:39 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
README.md Update tests/README to point to new doc. 2019-08-06 22:19:42 +00:00

This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/wiki/Testing.