[swift-evolution] Static Dispatch Pitfalls
Brandon Knope
bknope at me.com
Fri May 20 12:50:32 CDT 2016
Because I think the dynamic case is what most people expect and should be the default. The unexpected behavior should be the opt in behavior as you know what you are doing at this point. At least this is my reasoning
Brandon
> On May 20, 2016, at 1:39 PM, Krystof Vasa via swift-evolution <swift-evolution at swift.org> wrote:
>
> How about the other way around, allowing something like this, explicitly specifying the dynamic nature of the function, thus forcing the dynamic dispatch?
>
>
> protocol MyProtocol { }
>
> extension MyProtocol {
> dynamic func getInt() -> Int {
> return 0
> }
> }
>
> Krystof
>
>> I don’t think that would fly :-). That said, has anyone considered requiring a keyword on the method in the protocol extension that makes it explicit that the dispatch is non-dynamic?
>>
>> -Chris
>> _______________________________________________
>> 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/20160520/46498a99/attachment.html>
More information about the swift-evolution
mailing list