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
co19_2
corelib
corelib_2
dartdevc [ddc] Avoid emitting dead branches in conditionals 2022-05-03 20:17:44 +00:00
dartdevc_2
ffi
ffi_2
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
web_2
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.