Skip to content

Unexpected FutureOr<dynamic>% in CFE output #48768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chloestefantsova opened this issue Apr 8, 2022 · 1 comment
Closed

Unexpected FutureOr<dynamic>% in CFE output #48768

chloestefantsova opened this issue Apr 8, 2022 · 1 comment
Assignees
Labels
legacy-area-front-end Legacy: Use area-dart-model instead.

Comments

@chloestefantsova
Copy link
Contributor

The CFE produces a FutureOr type with unexpected Nullability.undetermined.

The following program demonstrates the issue:

foo(dynamic y) async {
  var a = await (<X>(List<X> Function() x, X x2) => x2)(() => y, throw 0);
}

The compiled program contains the unexpected FutureOr<dynamic>%.

library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;

static method foo(dynamic y) → dynamic async /* futureValueType= dynamic */ {
  dynamic a = await(<X extends core::Object? = dynamic>(() → core::List<X%> x, X% x2) → X% => x2)<FutureOr<dynamic>%>(() → core::List<FutureOr<dynamic>%> => y as{TypeError,ForDynamic,ForNonNullableByDefault} core::List<FutureOr<dynamic>%>, throw 0){(() → core::List<FutureOr<dynamic>?>, FutureOr<dynamic>?) → FutureOr<dynamic>?};
}
@chloestefantsova chloestefantsova added the legacy-area-front-end Legacy: Use area-dart-model instead. label Apr 8, 2022
@chloestefantsova chloestefantsova self-assigned this Apr 8, 2022
@chloestefantsova
Copy link
Contributor Author

I'm working on a fix at https://dart-review.googlesource.com/c/sdk/+/240722.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-front-end Legacy: Use area-dart-model instead.
Projects
None yet
Development

No branches or pull requests

1 participant