[swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

Adrian Zubarev adrian.zubarev at devandartist.com
Wed Jun 14 14:29:54 CDT 2017


I like the idea of fixing this area of the language and I’m happy to see others already pointed out that extend could be implicit and does not need to be introduced at all, where default would become necessary for protocol default implementations.

If I’m not mistaken this _can_ be an improvement now, which later could be syntactically sugared by default implementations in protocols (which would not require the default keyword):

https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md#default-implementations-in-protocols-



-- 
Adrian Zubarev
Sent with Airmail

Am 14. Juni 2017 um 20:46:50, Matthew Johnson via swift-evolution (swift-evolution at swift.org) schrieb:


On Jun 14, 2017, at 1:23 PM, Haravikk via swift-evolution <swift-evolution at swift.org> wrote:


On 14 Jun 2017, at 19:08, Xiaodi Wu via swift-evolution <swift-evolution at swift.org> wrote:

On Wed, Jun 14, 2017 at 1:01 PM, David Hart via swift-evolution <swift-evolution at swift.org> wrote:
Sorry, initially sent off-list:

I think this proposal is a great idea. But I would vote for the alternative of only having default and implicitly deducing extend when default is not specified:

This wouldn't work with the fundamental design decision that these are optional keywords, which IMO is absolutely key.

Hmm, I'm inclined to agree with David that only the default keyword really seems like it's necessary, and that extend can be implied.

My preference would be to just add the default keyword, and have breaches treated as warnings using the current behaviour, which we can eliminate and elevate to an error in future once people have had a chance to change their code.

I would support this if the core team is willing to take on the code churn it will cause.

_______________________________________________
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/20170614/6bdb610e/attachment.html>


More information about the swift-evolution mailing list