@@ -59,6 +59,7 @@ case .hawaiian:
59
59
throw BadFlavorError ()
60
60
case .pepperoni :
61
61
try validateNoVegetariansEating ()
62
+ return .delicious
62
63
case .cheese :
63
64
return .delicious
64
65
}
@@ -149,8 +150,8 @@ Modules consuming other modules with the language feature enabled will be forced
149
150
to add an ` @unknown default: ` case to any switch state for enumerations that are
150
151
not marked with ` @frozen ` . Importantly, this only applies to enums that are
151
152
imported from other modules that are not in the same package. For enums inside
152
- the same modules of the declaring package switches is still required to be
153
- exhaustive and doesn 't require an ` @unknown default: ` case.
153
+ the same modules of the declaring package switches are still required to be
154
+ exhaustive and don 't require an ` @unknown default: ` case.
154
155
155
156
Since enabling a language feature applies to the whole module at once we also
156
157
propose adding a new attribute ` @extensible ` analogous to ` @frozen ` . This
@@ -166,6 +167,9 @@ right default choice in both resilient and non-resilient modules and the new
166
167
proposed ` @extensible ` attribute primiarly exists to give developers a migration
167
168
path.
168
169
170
+ In non-resilient modules, adding the ` @extensible ` attribute to non-public enums
171
+ will produce a warning since those enums can only be matched exhaustively.
172
+
169
173
## Source compatibility
170
174
171
175
Enabling the language feature ` ExtensibleEnums ` in a module that contains public
@@ -176,9 +180,9 @@ Changing the annotation from `@extensible` to `@frozen` is a source compatible
176
180
change and will only result in a warning code that used ` @unknown default: `
177
181
clause. This allows developers to commit to the API of an enum in a non-source
178
182
breaking way.
179
- Adding an ` @extensible ` annotation is a source breaking change in modules that
180
- have ** not** enabled the ` ExtensibleEnums ` language features or are compiled
181
- with resiliency.
183
+ Adding an ` @extensible ` annotation to an exisitng public enum is a source
184
+ breaking change in modules that have ** not** enabled the ` ExtensibleEnums `
185
+ language features or are compiled with resiliency.
182
186
183
187
## Effect on ABI stability
184
188
0 commit comments