Objective-C protocols aren't imported in Swift as class protocols
| Originator: | info | ||
| Number: | rdar://19974021 | Date Originated: | 26-Feb-2015 12:20 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 8.0 |
| Classification: | Other Bug | Reproducible: | Always |
Summary: For example, protocol NSObjectProtocol is not tagged as `class`, which means that a struct could conform to it, but that wouldn’t make sense. Steps to Reproduce: Create an Objective-C protocol: `P`. Expected Results: It is imported in Swift as `@objc protocol P` or at least `protocol P: class`. Actual Results: Protocol is defined simply as `protocol P`. Notes: The compiler actually prevents you from doing something like `struct S: NSObjectProtocol`, with an error “non-class type ’S’ cannot conform to class protocol ‘NSObjectProtocol’”, but I see no indication of that in the Swift auto generated header.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!