Expand workarounds on 'Fixing type promotion failures' page #5461
Labels
a.effective-dart
Relates to the best practices explained in Effective Dart
a.language
Relates to the Dart language tour
dev.type-promotion
Relates to type promotion concepts and examples
dev.type-system
Relates to the type system in Dart
e2-days
Can complete in < 5 days of normal, not dedicated, work
p3-low
Valid but not urgent concern. Resolve when possible. Encourage upvote to surface.
st.triage.ltw
Indicates Lead Tech Writer has triaged
Page URL
https://dart.dev/tools/non-promotion-reasons.html
Page source
https://github.com/dart-lang/site-www/tree/main/src/tools/non-promotion-reasons.md
Describe the problem
We mostly present assigning fields to a shadowed local on this page, but I think an if-case statement is better in most cases if it matches your desired structure.
Expected fix
No response
Additional context
https://dart.dev/effective-dart/usage#consider-assigning-a-nullable-field-to-a-local-variable-to-enable-type-promotion should likely be updated as well.
The text was updated successfully, but these errors were encountered: