swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.03k stars 10.32k forks source link

[SR-200] Remove @objc requirement for specifying optional protocol methods #42822

Open swift-ci opened 8 years ago

swift-ci commented 8 years ago
Previous ID SR-200
Radar None
Original Reporter arthur (JIRA User)
Type Improvement
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 1 | |Component/s | Compiler, Standard Library | |Labels | Improvement | |Assignee | None | |Priority | Medium | md5: 295aff435f019895cd28d9719bbf68f1

Issue 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.

swift-ci commented 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:

Dante-Broggi commented 5 years ago

Can this be closed as "Won't Do"?