mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:49:00 +00:00
ce591d17c3
This change allows function literals in invocations to be inferred in dependency order. For example, given the following code: U f<T, U>(T Function() g, U Function(T) h) => h(g()); test() { var x = f(() => 0, (y) => [y]); } The function literal `() => 0` is inferred first, causing the type parameter `T` to be assigned the type `int`. Then, `(y) => [x]` is inferred with the benefit of this type assignment, so `y` gets the type `int`, and consequently, `U` gets assigned the type `List<int>`. This completes the support for https://github.com/dart-lang/language/issues/731 (improved inference for fold etc.) Change-Id: I48c22693720a1cc8bbf435643e863834e07f02b1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243002 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.