[swift-evolution] [Draft Proposal] Improve protocol inheritance behaviour

Jonathan Hull jhull at gbis.com
Mon Mar 13 17:41:39 CDT 2017


+1

> On Mar 13, 2017, at 11:24 AM, Nevin Brackett-Rozinsky via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I agree there is a problem here, and the mental model I want is for the language to act “as if” the default implementation of the protocol requirement “had actually been” implemented by each type which uses it.
> 
> In particular, if a class uses a default implementation for one of its protocol requirements, I want its subclasses to use the “override” keyword when implementing that method. After all the parent class *does* have a version of that method which can be called, it just happens to have received that version by default.
> 
> So, for the example in your proposal, I would prefer that the subclass write “override func doTheSecondThing()”.
> 
> Nevin
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list