[swift-evolution] ability to derive a class from a struct or other value type
jay at abbott.me.uk
Fri Jun 23 04:53:41 CDT 2017
What you're really after isn't "inheriting" from structs, you want to
easily "compose" your classes (or structs) using the implementation from
other implementation structs (components). I made a separate post all about
this - how to make composition part of the language.
On Fri, 23 Jun 2017 at 01:15 Mike Kluev via swift-evolution <
swift-evolution at swift.org> wrote:
> On 23 June 2017 at 02:43, Tony Allevato <tony.allevato at gmail.com
> <tony.allevato at gmail.com>> wrote:
>> There's been talk about "protocol forwarding" that I think would achieve
>> a lot of these goals, without the sharp edges involved trying to define
>> inheritance between a class and a struct. The proposed feature would
>> eliminate the boilerplate you're talking about.
>> I'm on my phone so I can't pull up links to old discussions, but Matthew
>> Johnson is who was pushing it so you may want to look back at what he's
>> said on the topic.
> thanks, i skimmed through it now and will have a closer look later.
> does it address (2) though? (preexisting value types we can't change)
> as to the sharp edges: i do not see a single one in the "manual"
> implementation of this approach and the idea of this proposal is that it is
> equivalent to the manual implementation...
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution