> On Apr 30, 2017, at 15:13, Gor Gyolchanyan <[email protected]> wrote: > > So, what you’re saying is essentially equivalent to replacing Optional struct > with an Optional protocol with a default AnyOptional struct implementation, > right? I suppose something semantically identical could be implemented that way, but...
> Having the bulk of compiler magic moved to a protocol was one of my proposed > solutions, but it still isn’t optimal due to associated types and need for > existential containers, that could seriously slow down the code, considering > the heavy use of Optional. That's the point of doing it through extending the generics system: there's no existential types to pass around because `Optional` is still a concrete type. It'll probably take the compiler a few more cycles to work out exactly what the concrete type is, but I don't think there'd be any more run-time overhead. At least I *think* it works that way... maybe not, though. - Dave Sweeris _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
