language icon indicating copy to clipboard operation
language copied to clipboard

Flow analysis - keep non-nullability on join

Open scheglov opened this issue 4 years ago • 4 comments

Here ancestor has initially type Element?, so cannot be promoted to either ClassElement or ExtensionElement. But it cannot be null if any of them is true.

    var ancestor = enclosingElement;
    if (ancestor is ClassElement || ancestor is ExtensionElement) {
      if (ancestor.hasDoNotStore) {
        return true;
      }
    }

scheglov avatar Dec 18 '20 03:12 scheglov