Closed esreli closed 5 years ago
Closing. Silly mistake. I was under the wrong impression that non exhaustive enums was to be introduced in Swift 5.1 but is already introduced in swift 5.
https://swift.org/migration-guide-swift5/
n Swift 5 mode, switches over enums, declared in Objective-C or coming from system frameworks, are required to handle “unknown cases”, i.e. cases that might be added in the future, or that may be defined “privately” in an Objective-C implementation file. (Formally, Objective-C allows storing any value in an enum as long as it fits in the underlying type.) These “unknown cases” can be handled by using the new @unknown defaultcase, which still provides warnings if any known cases are omitted from the switch. They can also be handled using a normal default.
Now triggers fatal error for unsupported enum cases.