Avoiding `enum` across `public` API boundaries?

I think this is mostly about "the Apple use case" when they update their library system wide and the apps are not yet recompiled †. It won't be a crash necessarily when a new enum case is added, just some previously untested code path in @unknown default will be taken (and perhaps this is what @curt meant by "a bug waiting to happen" but if there's more to it please correct me). Note that for equatable types I could simulate switch via if/else sequence, so it's not only about switching.

† Is this scenario relevant for a third party library developer? I guess it could still be a concern for libraries installed in global locations like /usr/lib or folders like homebrew, etc.

3 Likes

:100: for our apps and libraries. But huge vendors like Apple need a way to add cases without breaking all apps

1 Like