Files
sdk/pkg
Paul Berry 019755f77b Flow analysis: simplify marking of loop-assigned variables as not-unassigned
At the top of a loop, loop-assigned variables need to be marked as not
definitely unassigned, otherwise we will give incorrect results for
code like this:

```dart
f() {
  late int x;
  bool firstIteration = true;
  while (true) {
    if(firstIteration) {
      x = 0;
      firstIteration = false;
    } else {
      print(x); // BOGUS ERROR: x definitely unassigned
    }
  }
}
```

Previously, we were handling this by calling `joinUnassigned` at the
bottom of `removePromotedAll`, but it's simpler to just mark these
variables as not-unassigned while discarding promotions.  This change
will make the implementation more closely match spec changes I'll be
making shortly.

Change-Id: If50e28d20a75730aa5187a62ae5cac8690b0dfaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-30 02:46:26 +00:00
..
2020-06-26 20:59:28 +00:00
2020-06-17 16:35:56 +00:00
2020-06-25 20:12:32 +00:00