[swift-evolution] Proposal: Add @requires_super attribute

Tino Heth 2th at gmx.de
Wed Dec 16 16:04:55 CST 2015

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).

More information about the swift-evolution mailing list