> On Aug 2, 2017, at 23:21, Goffredo Marocchi <pana...@gmail.com> wrote:
> 
> 
> Sent from my iPhone
> 
> On 3 Aug 2017, at 01:09, Jordan Rose via swift-evolution 
> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
> 
>> 
>> 'required' initializers are like methods: they may require dynamic dispatch. 
>> That means that they get an entry in the class's dynamic dispatch table, 
>> commonly known as its vtable. Unlike Objective-C method tables, vtables 
>> aren't set up to have entries arbitrarily added at run time.
>> 
>> (Aside: This is one of the reasons why non-@objc methods in Swift extensions 
>> can't be overridden; if we ever lift that restriction, it'll be by using a 
>> separate table and a form of dispatch similar to objc_msgSend. I sent a 
>> proposal to swift-evolution about this last year but there wasn't much 
>> interest.)
> 
> If I missed replying to that originally I also missed the chance to say that 
> it would be a lovely idea and dynamic dispatch in some cases is just what the 
> doctor ordered (runtime editable method tables).
> This is especially especially important with extensions for classes and 
> default methods (and the current rules for overriding methods in the 
> implementing class), please resubmit the proposal :).

Thanks for the vote of confidence. :-) Here’s the old proposal for now, likely 
to be revised soon. 
https://github.com/jrose-apple/swift-evolution/blob/overridable-members-in-extensions/proposals/nnnn-overridable-members-in-extensions.md
 
<https://github.com/jrose-apple/swift-evolution/blob/overridable-members-in-extensions/proposals/nnnn-overridable-members-in-extensions.md>

Jordan
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to