Skip to content

Conversation

@srujzs
Copy link
Contributor

@srujzs srujzs commented Jun 17, 2024

_desugarTypedef accepts a _RawType and returns its underlying type if it's a typedef. However, it doesn't account for whether the _RawType is nullable or not. In order to accurately desugar a use of a typedef, we should union the _RawType's nullability with the underlying type's nullability. For example, SomeTypedef? should always be nullable after being desugared.

_desugarTypedef accepts a _RawType and returns its
underlying type if it's a typedef. However, it doesn't
account for whether the _RawType is nullable or not.
In order to accurately desugar a use of a typedef, we
should union the _RawType's nullability with the underlying
type's nullability. For example, `SomeTypedef?` should
always be nullable after being desugared.
@srujzs srujzs requested a review from sigmundch June 17, 2024 23:56
Copy link
Member

@sigmundch sigmundch left a comment

Choose a reason for hiding this comment

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

(consider also a CHANGELOG entry to indicate why some APIs are changing. Seems that all changes were in contravariant positions, so the change appears non-breaking?)

@srujzs
Copy link
Contributor Author

srujzs commented Jun 18, 2024

It is indeed non-breaking. Done, thanks!

@srujzs srujzs merged commit 6b8a465 into dart-lang:main Jun 18, 2024
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.

2 participants