[swift-evolution] Proposal: Add @requires_super attribute

Cullen MacDonald cullenbmacdonald at gmail.com
Wed Dec 16 16:38:42 CST 2015


huge +1 from me.

On Wed, Dec 16, 2015 at 5:16 PM, Marc Knaup via swift-evolution <
swift-evolution at swift.org> wrote:

> Default behavior would require something like "unrequire" which seems odd.
> Also this would break a lot of existing code and migration can't be done
> automatically.
>
> On Wed, Dec 16, 2015 at 11:04 PM, Tino Heth via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>> A huge +1 on this — I'd actually go one step further and propose to make
>> it the default behavior:
>> Calling super rarely hurts, and it would be easier to find a better name
>> for the attribute ;-) (maybe "replaceable"…)
>> Additionally, it is one step in the right direction for those who think
>> "final" should be default (if there is any good reason to prefer final over
>> requires_super, I haven't seen it yet).
>>
>> Instead of enforcing the call to super, it would be possible to
>> automatically run the super implementation after (or before) the overriding
>> method (unless it is explicitly called).
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151216/d5f006dc/attachment.html>


More information about the swift-evolution mailing list