Commit 922a031
authored
[ty] Fix
## Summary
Any `type` type can only be inhabited by class objects; any `type |
<dynamic type>` union could materialize to a class object; and any
`<class object> & <dynamic type>` intersection is a subtype of a class
object. So using a value that inhabits any of these types as a class
pattern should not cause us to emit the `invalid-match-pattern`
diagnostic.
This PR fixes several false positives that showed up in the ecosystem
report in #22939
## Test Plan
mdtests addedinvalid-match-pattern false positives (#23338)1 parent f76fe59 commit 922a031
2 files changed
Lines changed: 15 additions & 5 deletions
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
448 | 451 | | |
449 | 452 | | |
450 | 453 | | |
| |||
455 | 458 | | |
456 | 459 | | |
457 | 460 | | |
458 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
459 | 471 | | |
460 | 472 | | |
461 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5070 | 5070 | | |
5071 | 5071 | | |
5072 | 5072 | | |
5073 | | - | |
5074 | | - | |
5075 | | - | |
| 5073 | + | |
5076 | 5074 | | |
5077 | 5075 | | |
5078 | 5076 | | |
| |||
0 commit comments