Swift protocols don't attribute a parent ObjC protocol correctly
| Originator: | lickea | ||
| Number: | rdar://22785385 | Date Originated: | 21-Sep-2015 11:41 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 7.0 (7A220) |
| Classification: | Reproducible: | Always |
Summary: When an Objective-C protocol is extended by a Swift protocol, the class does not properly conform to the parent protocol. This is language independent. Steps to Reproduce: 1. Create a Swift protocol 2. Make that Swift protocol extend an Objective-C protocol 3. Implement a class that conforms to the Swift protocol 4. Check conformance to the Objective-C protocol Expected Results: The model (or class) conforms to the protocol. Actual Results: The model does not conform to the protocol. This fails using Swift’s `is` and `as` operators, as well as `conformsToProtocol:` in Objective-C. Notes: The Objective-C protocol can be defined in either language. If the class _explicitly_ declares that it implements the protocol, everything works as expected. Pure swift protocols do not exhibit this behavior.
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!