Commit 00e4c92
[flow] Part 3 Issue 3658 Avoid writing promotion information for postfix inc/dec expressions.
Postfix increment and decrement expressions should not be saving any promotion information.
An example of where saving the promotion information after the write is unsafe is:
```
class A {
A operator +(int i) {
return new B();
}
}
class B extends A {}
main() {
A x = A();
if ((x++) is B) {
// x should not be B
}
}
```
This change is only for the analyzer because the CFE does something different (converts the postfix increment/decrement into a let expression).
Bug: dart-lang/language#3658
Change-Id: Ic22f69bf79da66965908ade80bdf70399f0bcaa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391494
Reviewed-by: Paul Berry <[email protected]>
Commit-Queue: Kallen Tu <[email protected]>1 parent 507d40f commit 00e4c92
File tree
3 files changed
+69
-4
lines changed- pkg
- analyzer
- lib/src/dart/resolver
- test/src/dart/resolution
3 files changed
+69
-4
lines changedLines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
825 | 829 | | |
826 | 830 | | |
827 | 831 | | |
| |||
1818 | 1822 | | |
1819 | 1823 | | |
1820 | 1824 | | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
1821 | 1831 | | |
1822 | 1832 | | |
1823 | 1833 | | |
| |||
5296 | 5306 | | |
5297 | 5307 | | |
5298 | 5308 | | |
| 5309 | + | |
| 5310 | + | |
| 5311 | + | |
| 5312 | + | |
| 5313 | + | |
5299 | 5314 | | |
5300 | 5315 | | |
5301 | 5316 | | |
| |||
6274 | 6289 | | |
6275 | 6290 | | |
6276 | 6291 | | |
| 6292 | + | |
| 6293 | + | |
| 6294 | + | |
6277 | 6295 | | |
6278 | | - | |
| 6296 | + | |
| 6297 | + | |
6279 | 6298 | | |
6280 | 6299 | | |
6281 | 6300 | | |
| |||
6292 | 6311 | | |
6293 | 6312 | | |
6294 | 6313 | | |
6295 | | - | |
| 6314 | + | |
6296 | 6315 | | |
6297 | 6316 | | |
6298 | 6317 | | |
| |||
6891 | 6910 | | |
6892 | 6911 | | |
6893 | 6912 | | |
| 6913 | + | |
| 6914 | + | |
| 6915 | + | |
6894 | 6916 | | |
6895 | 6917 | | |
6896 | 6918 | | |
| |||
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
179 | | - | |
180 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
181 | 191 | | |
182 | 192 | | |
183 | 193 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
18 | 51 | | |
19 | 52 | | |
20 | 53 | | |
| |||
0 commit comments