** **
On May 4 2016, at 5:37 pm, James Froggatt <[email protected]> wrote: > I was thinking that requiring instance properties would mean the value could only be a struct, but rethinking, I realise computed properties would work fine for protocol conformance, so this isn't actually true. > > > > I agree with your support of focusing on interface. Your implications for AnyObject and AnyValue are interesting - that reference-type and value-type semantics are a kind of interface… > > > > One thing occurs to me, thinking about this: what if protocols could require enum cases? This could allow a Failable protocol with .failure(ErrorType), for example; or Nillable, which could implement NilLiteralConvertible for enums with a .none case… I'm not sure, maybe this wouldn't be so useful in practice? Basically you are asking to initialize with something, and not read from it later. So better to just have a: init(error: ErrorType) I think. And use NilLiteralConvertible! Enums are tightly coupled to their structure, and I imagine compile down to some sort of bit offset, so you can’t really have a generic .failure case that would work with all enums, as they will be at different offsets in the enum. > > > From James F **Patrick Smith**
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
