Can class variables explicitly checked for null be assumed non-null? #1472
Labels
feature
Proposed language feature that solves one or more problems
state-duplicate
This issue or pull request already exists
I testing the following class in dartpad using Dart SDK 2.12.0-51.0.dev
The compiler complains that
types
may be null in the print statement."An expression whose value can be 'null' must be null-checked before it can be dereferenced - line 16"
I realize the docs say
" The analyzer can’t model the flow of your whole application, so it can’t predict the values of global variables or class fields."
but I wonder in the case were we explicitly check if a class var is not null is supposed to be or could be handled?
The text was updated successfully, but these errors were encountered: