I must be botching my message. Let me restate again: I’m arguing that protocols are fundamentally different from types precisely because you would never elide a type, not even (as you point out) an uninhabitable type. This is why I argue it’s entirely consistent for classes not to be open by default and protocols to behave differently.
We would definitely not have that, and for at least three reasons:
-
A “closed” (now called “frozen”) enum as envisioned can never have any cases if it does not currently have cases. What you call a “closed” protocol is only forbidden from ever having external cases. When the design is completed, we will be able to guarantee for all time that
public frozen enum Neverwill always be uninhabited. But in your design it would be possible for a later version of the standard library to conform a type topublic protocol Never. That is not a suitable design for a bottom type. -
An existential
Pdoes not conform to protocolP. However, in a completed implementation of a type system with a bottom type, the bottom type would conform to all protocols. We’d never be able to complete a design whereNeveris both a protocol and a bottom type. This cannot even be improved by somehow makingPconform toP: the protocolPwould not be at the bottom of the hierarchy because the existential typePwould then conform to it. In other words, the bottom type must always be a type and not a protocol. Except, with this protocol-based design, you would have both a bottom type and an identically named extraneous protocolPto which it conforms with no particular purpose. -
Neverreceives no special treatment from the compiler. Any uninhabitable type behaves identically toNever. You can demonstrate this for yourself by creating your own enum with no cases: you will find that you can use that type in place ofNever. Even if the theoretical barriers above did not exist, it would not change the fact that enums with no case are uninhabitable and therefore a way of expressing the bottom type. It would not make sense to introduce new syntax to enable a second way to express the same thing.
This is all to demonstrate, in a different setting, how types and protocols differ in some fundamental ways.