Skip to content

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

Description

@chloestefantsova

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.

Metadata

Metadata

Labels

cherry-pick-approvedLabel for approved cherrypick requestcherry-pick-mergedCherry-pick has been merged to the stable or beta branch.cherry-pick-reviewIssue that need cherry pick triage to approvelegacy-area-front-endLegacy: Use area-dart-model instead.merge-to-stabletriage-automationSee https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions