[analyzer] Implement new rules about 'derives a future type' #55051
Labels
analyzer-spec
Issues with the analyzer's implementation of the language spec
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
implementation
Track the implementation of a specific feature (use on area-meta issue, not issues for each tool)
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
The language team has just agreed to land dart-lang/language#3574, which is an update to the definition of the function flatten and the associated concept about how "a type
T
derives a future typeF
".Some background discussion can be found in #54628. The main point is that the new definition includes the ability to find a supertype of the form
Future<...>
,FutureOr<...>
,Future<...>?
, orFutureOr<...>?
that were previously not found.This change is not considered to be a breaking change because the CFE already implements the updated rule.
A test of the new rule is landed by https://dart-review.googlesource.com/c/sdk/+/354020, as
tests/language/async/derive_future_type_test.dart
.The text was updated successfully, but these errors were encountered: