[swift-evolution] [Pitch] Changing NSObject dispatch behavior
Brian King
brianaking at gmail.com
Thu Dec 15 21:03:24 CST 2016
On Thu, Dec 15, 2016 at 3:51 PM, Michael Ilseman <milseman at apple.com> wrote:
> You would want a class-level `dynamic` that would also implicitly apply to
> any subclasses? This feels a little different than how Swift normally
> chooses defaults, could you elaborate more on why or if there’s anything
> else in the language analogous to this?
>
I'm not entirely sure how it should behave to be honest. Having the
`dynamic` version of `final` would be a nice feature though. Since final
stops inheritance as well, it could be considered as influencing the entire
class hierarchy! I think this could be a large lever and effect the entire
hierarchy, or a smaller lever and just effect the declaration. I was
thinking that it would influence all the subclasses as well.
> I’m not familiar enough with these kinds of bugs. Kevin, do you think the
> existing behavior aligns with or runs counter to safe-by-default?
>
It's interesting hearing this called 'safe by default'. To me it's unsafe
by default since you can use KVO and it can compile and not work, and only
1 paragraph in the Swift book, or experience will teach you this.
> That’s a very thoughtful and informative post, thank you for writing it! I
> haven’t read the whole thing, but relevant to this, here are a couple
> tweaks:
>
Thanks for the feedback! I'm going to update the post soon and will add
that to the list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161215/50203aaf/attachment.html>
More information about the swift-evolution
mailing list