[cfe] Use flatten(T) as future value type for pre-nnbd async functions
Change-Id: I38d537112e66c08bb06bc2493b3126b5f8f797b7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239022 Reviewed-by: Chloe Stefantsova <cstefantsova@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
committed by
Commit Bot
parent
a6acb1a5f0
commit
e16a4e76e6
@@ -3673,6 +3673,10 @@ class FunctionNode extends TreeNode {
|
||||
/// here the return types are `Future<Foo>` and `FutureOr<Foo>` for `method1`
|
||||
/// and `method2`, respectively, but the future value type is in both cases
|
||||
/// `Foo`.
|
||||
///
|
||||
/// For pre-nnbd libraries, this is set to `flatten(T)` of the return type
|
||||
/// `T`, which can be seen as the pre-nnbd equivalent of the future value
|
||||
/// type.
|
||||
DartType? futureValueType;
|
||||
|
||||
void Function()? lazyBuilder;
|
||||
|
||||
@@ -440,7 +440,6 @@ class VerifyingVisitor extends RecursiveResultVisitor<void> {
|
||||
AsyncMarker savedAsyncMarker = currentAsyncMarker;
|
||||
currentAsyncMarker = node.asyncMarker;
|
||||
if (!isOutline &&
|
||||
currentMember!.isNonNullableByDefault &&
|
||||
node.asyncMarker == AsyncMarker.Async &&
|
||||
node.futureValueType == null) {
|
||||
problem(node,
|
||||
|
||||
Reference in New Issue
Block a user