Commit fadf6ec
committed
[Sema] Remove @unknown default requirement for package enums.
`@unknown default` in switch statements are required for resilient enums since they
might be modified with new fields in the future and modules defining the enums are
generally not built together with the consuming modules.
However, if the modules are in the same package, they are required to be built together,
thus the requirement for `@unknown default` can be skipped. This PR removes the need for
that, enabling less boilerplate. Note this change only impacts typecheck and not SIL gen.
Resolves rdar://130015149.1 parent 29a4b8a commit fadf6ec
File tree
5 files changed
+418
-177
lines changed- include/swift/AST
- lib
- AST
- Sema
- test/Sema
5 files changed
+418
-177
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4726 | 4726 | | |
4727 | 4727 | | |
4728 | 4728 | | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
4729 | 4738 | | |
4730 | 4739 | | |
4731 | 4740 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6559 | 6559 | | |
6560 | 6560 | | |
6561 | 6561 | | |
| 6562 | + | |
| 6563 | + | |
| 6564 | + | |
| 6565 | + | |
| 6566 | + | |
6562 | 6567 | | |
6563 | 6568 | | |
6564 | 6569 | | |
| |||
6576 | 6581 | | |
6577 | 6582 | | |
6578 | 6583 | | |
6579 | | - | |
6580 | | - | |
6581 | | - | |
6582 | | - | |
| 6584 | + | |
| 6585 | + | |
6583 | 6586 | | |
6584 | 6587 | | |
6585 | | - | |
6586 | | - | |
6587 | 6588 | | |
6588 | 6589 | | |
6589 | 6590 | | |
| |||
6615 | 6616 | | |
6616 | 6617 | | |
6617 | 6618 | | |
6618 | | - | |
6619 | | - | |
6620 | | - | |
6621 | | - | |
6622 | | - | |
| 6619 | + | |
| 6620 | + | |
| 6621 | + | |
| 6622 | + | |
| 6623 | + | |
| 6624 | + | |
| 6625 | + | |
6623 | 6626 | | |
6624 | 6627 | | |
6625 | 6628 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
861 | 861 | | |
862 | 862 | | |
863 | 863 | | |
864 | | - | |
| 864 | + | |
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
| |||
0 commit comments