Introducing Namespacing for Common Swift Error Scenarios

We address this in the document:

In other words, sometimes a build warning about unimplemented code is insufficient or inappropriate for the purpose. For definite examples, look no further than NSUnimplemented() scattered all over swift-corelibs-foundation.

As for the suggestion about making FatalReason an enum instead of a struct... functionally an enum backed by String would be equivalent to a struct with a single String field. However, the semantics are different. It is far easier to add new "cases" to a struct than to an enum. An enum implies exhaustiveness, which would incorrectly lead people to believe that you can't add new cases. A struct has no such implication.

1 Like