[swift-evolution] Add code to super methods.
Tino Heth
2th at gmx.de
Sat Nov 19 11:08:24 CST 2016
I still thing that the naming is one of the hardest parts:
Imho "@super" just feels wrong — the word has already a meaning, and it should only be used when referring to the parent class (here, it is a restriction/hint for subclasses).
The best I can think of would be @extend (because it is about extension of the marked method)
I definitely support the idea in general, so I've something to add:
— There are already cases where super shouldn't be called (never?)
— Imho before and after only make sense if the call to super is generated automatically when it is omitted: The restriction on the order afaics offers very little (if any) additional safety, and it isn't clear how defer would interact with before.
Some questions that should imho be addressed in a formal proposal:
What about parameters and return values? Should it be possible to change those? I think so, but that would make the feature more dangerous than pure monitoring. If it's forbidden to change anything, we loose flexibility, and if it's configurable, complexity is raised.
- Tino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161119/8f8ff83f/attachment.html>
More information about the swift-evolution
mailing list