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

Add details for non-promotion causes/workarounds #2940

Closed
kwalrath opened this issue Feb 11, 2021 · 3 comments · Fixed by #3253
Closed

Add details for non-promotion causes/workarounds #2940

kwalrath opened this issue Feb 11, 2021 · 3 comments · Fixed by #3253
Assignees
Labels
dev.null-safety Relates to transforming or migrating Dart code to sound null safety e2-days Can complete in < 5 days of normal, not dedicated, work p1-high Major but not urgent concern: Resolve in months. Update each month.

Comments

@kwalrath
Copy link
Contributor

kwalrath commented Feb 11, 2021

Details in dart-lang/sdk#44900.

#3148 partially addressed this issue by adding the following:

https://dart.dev/tools/non-promotion-reasons
https://dart.dev/go/non-promo-write
https://dart.dev/go/non-promo-property
https://dart.dev/go/non-promo-this

The current plan is to have one go link for each kind of non-promotion, with each go link redirecting to a section of this new page. See dart-lang/sdk#44900 (comment) for all 11 proposed go links.

Example from Lasse & mit

Note that BadEvent needs to use year! because year could have been changed by an overriding getter in a subclass. GoodEvent shadows year with a local variable (var year = this.year) so that the code can just use year.

@kwalrath kwalrath self-assigned this Feb 11, 2021
@kwalrath kwalrath added e1-hours Can complete in < 8 hours of normal, not dedicated, work dev.null-safety Relates to transforming or migrating Dart code to sound null safety p1-high Major but not urgent concern: Resolve in months. Update each month. labels Feb 11, 2021
@kwalrath
Copy link
Contributor Author

I believe this is covered by https://dart.dev/guides/language/effective-dart/usage_migrated#consider-copying-a-nullable-field-to-a-local-variable-to-enable-type-promotion (which will be moved to https://dart.dev/guides/language/effective-dart/usage once null safety is in the stable SDK).

I wonder if this should also be in the FAQ, which is based on an internal FAQ.

/cc @ryanmcginnis @davidmorgan

@kwalrath kwalrath added p2-medium Necessary but not urgent concern. Resolve when possible. and removed p1-high Major but not urgent concern: Resolve in months. Update each month. labels Mar 11, 2021
@kwalrath kwalrath changed the title Add promotion info/workaround to /null-safety Add page for non-promotion info/workarounds Apr 5, 2021
@kwalrath kwalrath added this to the Next dev release milestone Apr 5, 2021
@kwalrath kwalrath added p1-high Major but not urgent concern: Resolve in months. Update each month. and removed p2-medium Necessary but not urgent concern. Resolve when possible. labels Apr 14, 2021
@kwalrath kwalrath changed the title Add page for non-promotion info/workarounds Add details for non-promotion causes/workarounds May 14, 2021
@kwalrath
Copy link
Contributor Author

I'm working on this and hope to have something for @stereotype441 to look at early next week. I/O permitting. :)

@kwalrath
Copy link
Contributor Author

The updated page is out: https://dart.dev/tools/non-promotion-reasons

@kwalrath kwalrath added e2-days Can complete in < 5 days of normal, not dedicated, work and removed e1-hours Can complete in < 8 hours of normal, not dedicated, work labels Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev.null-safety Relates to transforming or migrating Dart code to sound null safety e2-days Can complete in < 5 days of normal, not dedicated, work p1-high Major but not urgent concern: Resolve in months. Update each month.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants