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

[CP] Place return type into parameter scope in TypeBuilderComputer #55158

Closed
chloestefantsova opened this issue Mar 11, 2024 · 3 comments
Closed
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. cherry-pick-review Issue that need cherry pick triage to approve merge-to-stable triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.

Comments

@chloestefantsova
Copy link
Contributor

Commit(s) to merge

9ba8663

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/356760

Issue Description

In the CFE the procedure that performed reading of a function type from a dill file placed the return type of the function type outside of the scope of the structural parameters of that function type, leading to a crash, whenever the incremental compiler was loading a typedef from a dill file, the said typedef contained a generic function type on the right-hand side, and the return type of the function type contained references to the structural parameters of the function type.

What is the fix

The fix moves the lines that restore the return type of the function type to the place after the structural parameter scope is built for the current function type.

Why cherry-pick

The described case of typedefs having a specific shape is believed to be fairly widespread and was encountered in Flutter. The impact of the addressed bug is considered to be severe.

Risk

low

Issue link(s)

flutter/flutter#143689

Extra Info

The fix was landed in https://dart-review.googlesource.com/c/sdk/+/355401 to main, and the tests were landed separately in https://dart-review.googlesource.com/c/sdk/+/355142.

@chloestefantsova chloestefantsova added the cherry-pick-review Issue that need cherry pick triage to approve label Mar 11, 2024
@itsjustkevin
Copy link
Contributor

@johnniwinther can you take a look at this cherry-pick request?

@johnniwinther
Copy link
Member

LGTM

@itsjustkevin itsjustkevin added merge-to-stable cherry-pick-approved Label for approved cherrypick request labels Mar 13, 2024
@dart-github-bot
Copy link
Collaborator

Item Details
Summary The CFE crashed when loading a typedef from a dill file with a generic function type on the right-hand side and the return type contained references to the structural parameters of the function type.
Triage to area-front-end

(what's this?)

@dart-github-bot dart-github-bot added area-front-end Use area-front-end for front end / CFE / kernel format related issues. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. labels Mar 13, 2024
copybara-service bot pushed a commit that referenced this issue Mar 14, 2024
…mputer

Closes flutter/flutter#143689

Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/355401
Cherry-pick-request: #55158
Change-Id: I129458871c91f1d7a1c331a62f2388e3431fe271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356760
Reviewed-by: Johnni Winther <[email protected]>
@itsjustkevin itsjustkevin added the cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. cherry-pick-review Issue that need cherry pick triage to approve merge-to-stable triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.
Projects
None yet
Development

No branches or pull requests

8 participants