Commit 780af0f
Flow analysis: promote to "types of interest" on assignment.
This allows so-called "ensure guarded" promotions, e.g.
- `if (x is! int) x = 0;`
- `if (x == null) x = 0;`
- `x ??= 0;`
The latter two are particularly important to prepare for NNBD.
Change-Id: Ib53ca916e6d485945326b19e86f8cfb5b3ee2160
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123280
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>1 parent d213d3c commit 780af0f
File tree
11 files changed
+831
-302
lines changed- pkg
- analyzer/lib/src
- dart/resolver
- generated
- front_end
- lib/src/fasta/flow_analysis
- test
- fasta/flow_analysis
- flow_analysis
- nullability/data
- type_promotion
- data
- nnbd_migration/lib/src
11 files changed
+831
-302
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3130 | 3130 | | |
3131 | 3131 | | |
3132 | 3132 | | |
3133 | | - | |
| 3133 | + | |
3134 | 3134 | | |
3135 | 3135 | | |
3136 | 3136 | | |
| |||
Lines changed: 382 additions & 190 deletions
Large diffs are not rendered by default.
0 commit comments