[swift-evolution] [Draft] Mixins

Niall Young niall at iinet.net.au
Thu Apr 21 19:36:30 CDT 2016


On Thu, 21 Apr 2016 James Froggatt <conductator at ntlworld.com> wrote:

> Could traits be constructed from protocol extensions in this way, or otherwise end up competing with them if just some of these features were to be added? My concern is that adding traits as a separate language feature could put them in direct competition with protocol extensions.

They should definitely be some _form_ of protocol extension, just the rules around their consumption would be different to the current constraint of static vs. dynamic dispatch.

Traits could be a second example of the underlying Type behind Extensions, or Trait functionality could be added to Extensions directly in terms of how they are consumed, how conflicts are resolved, and how dynamic vs. static dispatch is handled, independent of any consumer-level requirements or rules.

--
Niall Young
niall at iinet.net.au


More information about the swift-evolution mailing list