[swift-users] Why can't structs inherit from other structs?

Tino Heth 2th at gmx.de
Wed Aug 3 03:48:19 CDT 2016


> Protocols currently require you to redeclare their properties, but we could add a feature to change that if there was a strong enough justification.
Sometimes, this would be very handy (not only for structs) — but I'd expect that there are at least as many cases where you don't want that behavior…
It would be possible to silently generate readwrite-properties (and even functions returning void or an optional), but that feels a little bit to much magic for me.

Also, this would be a use-case for protocols that is completely different from their normal role.


More information about the swift-users mailing list