<div dir="ltr">Hello Swift Evolution,<div><br></div><div>I&#39;d like to propose that a warning be emitted when default cases are omitted for enums from other modules. </div><div><br></div><div>What this would look like:</div><div><br></div><div>OtherModule:</div><div>```</div><div>public enum SomeEnum {</div><div>    case one</div><div>    case two</div><div>}</div><div><br></div><div>public let global: SomeEnum = .one</div><div>```</div><div><br></div><div>executable:</div><div>```</div><div>import OtherModule</div><div><br></div><div>switch OtherModule.global {</div><div>    case .one: break</div><div>    case .two: break</div><div>    ^~~~~ ⚠︎ Warning: Default case recommended for imported enums. Fix-it: Add `default: break`</div><div>}</div><div>```</div><div><br></div><div>Why:</div><div><br></div><div>Allowing the omission of a default case in an exhaustive switch makes the addition of a new case to the enum a breaking change. </div><div>In other words, if you&#39;re exhaustively switching on an enum from an imported library, the imported library can break your code by adding a new case to that enum (which the library authors may erroneously view as an additive/minor-bump change).</div><div><br></div><div>Background:</div><div><br></div><div>As a maintainer of a Swift framework, public enums have been a pain point in maintaining semver. They&#39;ve made it difficult to implement additive features and have necessitated the avoidance of enums in our future public API plans.</div><div><br></div><div>Related Twitter thread: <a href="https://twitter.com/tanner0101/status/796860273760104454">https://twitter.com/tanner0101/status/796860273760104454</a></div><div><br></div><div>Looking forward to hearing your thoughts.</div><div><br></div><div>Best,</div><div>Tanner</div><div><br></div><div><div style="font-family:&#39;sf ui text&#39;;font-size:12px"><font color="#5f5f5f">Tanner Nelson</font></div><div style="font-family:&#39;sf ui text&#39;;font-size:12px"><font color="#9dacd1">Va</font><font color="#aeb2cf">p</font><font color="#c8bacd">o</font><font color="#d0becc">r</font><font color="#9dacd1"> </font></div><div style="font-family:&#39;sf ui text&#39;;font-size:12px"><font color="#676767">+1 (435) 773-2831</font></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>