Breaking change #54002: Modify the 'UP' algorithm to handle intersection types earlier

83 views
Skip to first unread message

Erik Ernst

unread,
Dec 1, 2023, 12:28:19 PM12/1/23
to anno...@dartlang.org, Dart-Discuss, Dart Misc
This breaking change modifies the computation of the standard upper bound (also known as the least upper bound) of multiple types, that is, it modifies the definition of the function UP.

The only change to this function is that the cases dealing with intersection types (types of the form X & B, which can be created by promotion of variables) are moved up such that they occur earlier in the definition of UP. We do this because the old rules were capable of creating types that are not well-formed; the new rules will only compute well-formed types.

We have found just 2-3 locations in internal Google code where this change causes breakage, and we expect the breakage to be very limited in general.

There will not be any migration work to do for Google internal code that you own, the Dart team will handle the breakage.

Further details can be found in the breaking change issue: https://github.com/dart-lang/sdk/issues/54002.

Please comment on this issue if this breaking change poses a severe problem for you.

  best regards,

--
Erik Ernst  -  Google Danmark ApS
Skt Petri Passage 5, 2 sal, 1165 København K, Denmark
CVR no. 28866984

Reply all
Reply to author
Forward
0 new messages