Skip to content

[CP] Fix crashes due to unhandled StructuralParameterTypes in UP in the CFE #56457

@chloestefantsova

Description

@chloestefantsova

Commit(s) to merge

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

Target

stable

Prepared changelist for beta/stable

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

Issue Description

The algorithm for computing the standard upper bound of two types, also known as UP, was partially missing its implementation for StructuralParameterType objects. In some corner casing the lacking implementation resulted in a crash of the compiler. All platforms using the CFE were affected.

What is the fix

The fix adds the missing part of the UP algorithm.

Why cherry-pick

The crashes due to the lacking implementation of UP in the CFE were reported by Flutter users: flutter/flutter#152984.

Risk

Low. The update is local and minimal and passes our CQ tests. Moreover, the missing part of the algorithm is implemented via abstracting a similar part of the same algorithm for TypeParameterType objects and applying it to StructuralParameterType objects.

Issue link(s)

flutter/flutter#152984

Extra Info

No response

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.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions