Open swift-ci opened 8 years ago
Comment by Aaron Brager (JIRA)
There's some discussion about this here: http://thread.gmane.org/gmane.comp.lang.swift.evolution/13347
I think the consensus is that there's already a few ways to do that:
use protocol extensions to create a no-op implementation for the optional items
make a separate protocol for the optional items
use some other type (like an optional closure) to optionally coordinate behavior with another type
Can this be closed as "Won't Do"?
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 1 | |Component/s | Compiler, Standard Library | |Labels | Improvement | |Assignee | None | |Priority | Medium | md5: 295aff435f019895cd28d9719bbf68f1Issue Description:
The Swift Programming Language states that the @objc attribute is required when declaring optional methods in a protocol.
I'm assuming it has to do with ObjC interoperability. I'd love to know about the reasoning behind this implementation as well.
If this is something that is surmountable, I'd love if that requirement could be removed in a future version of Swift.