You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No, only local variables can be promoted. There are considerations about allowing instance variables to be promoted as well, but the current rules don't promote them. The main issue is that it is not sound to promote an instance variable, because it can be overridden by a getter running arbitrary code and that getter is not known to return the same object each time it is invoked.
I maybe miss something but shouldn't the
name
property be promoted to NonNull in this example ? https://nullsafety.dartpad.dev/dcb8f17148eb07b1b7c36442eb2d53d7In DartPad (Dart SDK 2.10.0), the analyzer feedback is :
A value of type 'String?' can't be assigned to a variable of type 'String'.
The text was updated successfully, but these errors were encountered: