Commit f351ec4
committed
allow nullability flow typing even in presence of pattern match
Nullability flow typing is conservatively disabled for mutable
variables to which a write occurs nested inside a Tree other than
some known ones, such as If and WhileDo. This is to prevent flow-sensitive
reasoning for variables that are captured and written to in a closure.
Pattern matches do not create a closure. This change enables nullability
flow typing even for mutable variables that are written to inside a pattern
match.1 parent 492f777 commit f351ec4
File tree
2 files changed
+9
-1
lines changed- compiler/src/dotty/tools/dotc/typer
- tests/explicit-nulls/pos
2 files changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments