- 
                Notifications
    
You must be signed in to change notification settings  - Fork 227
 
Closed
Labels
field-promotionIssues related to addressing the lack of field promotionIssues related to addressing the lack of field promotion
Description
One can statically prove that this code does not have a null dereference risk:
class A {
  int _foo;
  void test() {
    if (_foo != null)
      print(_foo + 1);
  }
}As far as I can tell, there is no way, even with implements and noSuchMethod and other shenanigans, for _foo to ever be null on the line with the print.
cc @leafpetersen who pointed out that some similar cases aren't so cut and dry because privates can be implemented using noSuchMethod.
tvolkert and deimantasa
Metadata
Metadata
Assignees
Labels
field-promotionIssues related to addressing the lack of field promotionIssues related to addressing the lack of field promotion