Beacuse it is not an ordinary conformance. It is more about constructors as you put, which imo has little to do with var\func
s and more with init
s.
ps
If it matters, I have seen some feedback that uses a pattern that allows to provide a type with default value aka null state, but imo this is a job for constructors without parameters. So it should be more like this
protocol HasDefaultConstructor {
init()
}
protocol DefaultStateProvider: HasDefaultConstructor {
static var defaultState: Self { get }
}
enum Mood: DefaultStateProvider {
case good, bad, neutral
init() { self = .neutral }
static var defaultState: Mood { self.init() }
}
let thisProposalMadeMeFell_ = Mood()
Besides that the presence of default
case in enum is actuallly nonsence based on what I have this in this thread, treating cases as var/func witneses which are in fact semanticaly behave as inits seems like an introduction of intentional confusion.
-1 again.