Skip to content

Commit 0735a82

Browse files
committed
Pitch feedback
1 parent f718b7d commit 0735a82

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

proposals/NNNN-extensible-enums.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ non-resilient Swift.
139139
We propose to introduce a new language feature `ExtensibleEnums` that aligns the
140140
behaviour of enumerations in both language dialects. This will make **public**
141141
enumerations in packages a safe default and leave maintainers the choice of
142-
extending them later on.
142+
extending them later on. We also propose to enable this new language feature
143+
by default with the next lagnuage mode.
143144

144145
In modules with the language feature enabled, developers can use the existing
145146
`@frozen` attribute to mark an enumeration as non-extensible, allowing consumers
@@ -194,12 +195,12 @@ This proposal only affects API resilience of non-resilient libraries, by enablin
194195

195196
## Future directions
196197

197-
### Enable `ExtensibleEnums` by default in a future language mode
198+
### `@unkown case`
199+
200+
Enums can be used for errors. Catching and pattern matching enums could add
201+
support for an `@unknown catch` to make pattern matching of typed throws align
202+
with `switch` pattern matching.
198203

199-
We believe that extensible enums should be default in the language to remove the
200-
common pitfall of using enums in public API and only later on realising that
201-
those can't be extended in an API compatible way. Since this would be a large
202-
source breaking change it must be gated behind a new language mode.
203204

204205
## Alternatives considered
205206

0 commit comments

Comments
 (0)