[swift-evolution] Require use of override keyword to override dynamically dispatched methods defined in a protocol with a default implementation

Brent Royal-Gordon brent at architechies.com
Wed Jan 6 14:42:07 CST 2016


> Another option might be to allow imported definitions to be used by a conformance without the `override` marking to support retroactive modeling while requiring definitions in the same module as the conformance to explicitly specify the `override`.

But the same problem exists if you want to do this to `internal` types using a `private` protocol. There you *could* make the protocol `internal` and call `override` in all the right places, but if the protocol is an implementation detail of one particular file, why should you?

(Thanks for the term "retroactive modeling", by the way—I couldn't remember it.)

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list