mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:07:11 +00:00
0d636e5543
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> |
||
---|---|---|
.. | ||
co19 | ||
co19_2 | ||
corelib | ||
corelib_2 | ||
dartdevc | ||
dartdevc_2 | ||
ffi | ||
ffi_2 | ||
language | ||
language_2 | ||
lib | ||
lib_2 | ||
modular | ||
standalone | ||
standalone_2 | ||
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.