Skip to content
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

Adjust definition of flatten #2696

Merged
merged 1 commit into from
Dec 8, 2022
Merged

Adjust definition of flatten #2696

merged 1 commit into from
Dec 8, 2022

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Dec 8, 2022

Adjust definition of flatten to ensure that flatten(X) == X when X is a type variable which is unrelated to future types. It deletes the case which is explicitly dealing with type variables, and relies on the existing cases where the given type is related to FutureOr or Future, but adds one thing: The FutureOr case is applicable to types that are bounded by FutureOr<S> for some S, not just the ones that are FutureOr<S>, and this includes X extends FutureOr<S>.

…is a type variable which is unrelated to future types
@eernstg eernstg requested a review from lrhn December 8, 2022 15:03
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

Visit the preview URL for this PR (updated for commit b272cd5):

https://dart-specification--pr2696-specify-flatten-dec2-jxery4vn.web.app

(expires Thu, 15 Dec 2022 15:04:29 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6941ecd630c4f067ff3d02708a45ae0f0a42b88a

Copy link
Member

@lrhn lrhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it!

@eernstg eernstg merged commit b68d1a5 into master Dec 8, 2022
@eernstg eernstg deleted the specify_flatten_dec22 branch December 8, 2022 17:39
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Dec 13, 2022
The definition of flatten was adjusted in
dart-lang/language#2696
such that it better preserves the type information when the type of `e`
in `await e` is a type variable. This CL changes the test to expect
the behavior of the newly specified flatten.

The test has been renamed to 'await_flatten_test.dart'.

Change-Id: Iaf67a53cd3cd181bcb3eb6e85beca7cc1af4d34a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274682
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants