[swift-evolution] Static Dispatch Pitfalls
matthew at anandabits.com
Sat May 21 16:22:25 CDT 2016
Sent from my iPad
On May 21, 2016, at 3:16 PM, Brent Royal-Gordon <brent at architechies.com> wrote:
>>> Where was proposed to force them to be final and was just trying to provide an example in which the conforming class may want to override them, so forcing them final isn't a good idea.
>> Again, nobody ever proposed forcing them final. The proposal was to use final as a way to document the existing behavior.
> I *did* propose forcing them final, and I'm still very skeptical that a `nondynamic` keyword that does nothing when you shadow the method is a good idea. People are still going to naïvely try to override these methods and be surprised when it doesn't work. A `nondynamic` keyword at the original declaration site will help them understand what happened when they're investigating the bug, but it still seems like this kind of code is so suspect that Swift ought to flag it from the start.
Sorry about that. Either I didn't see that or I forgot about it. Making them 'final' causes problems with retroactive modeling. There are other issues as well but that is the most significant one.
> Brent Royal-Gordon
More information about the swift-evolution