It's a semantic conflict. private(init)
prevents code outside the declaring file from creating an instance. But that is defeated if the compiler makes a value of that case available via allCases
. If the compiler does synthesize CaseIterable
for an enum with a case initializer less visible than the type at minimum there should be a diagnostic about this. private(init)
would be pretty pointless. It would even be possible to write a static computed property that looks just like the case initializer in an extension.