@available attributes in Swift do not carry to Objective-C
| Originator: | craig.pearlman | ||
| Number: | rdar://24304256 | Date Originated: | 22-Jan-2016 03:37 PM |
| Status: | Open | Resolved: | |
| Product: | Xcode | Product Version: | 7.2 |
| Classification: | Reproducible: | Always |
Summary: If a code is marked with an @available attribute, and the code is also made available in Objective-C, the auto-generated Objective-C "bridge" does not mark its code as deprecated. Steps to Reproduce: 1. Create a simple Swift type and mark it deprecated, for example: @available(iOS, introduced=8.0, deprecated=9.0, message="Stop using this.") 2. Make sure the type is available in Objective-C. 3. Use the deprecated type in some Swift code. 4. Use the deprecated type in some Objective-C code. 5. Build. Expected Results: Deprecation warnings appear in both Swift and Objective-C code. Actual Results: Deprecation warnings appear only in Swift code. Version: Xcode 7.2 Notes: This was observed on a Swift class extension on NSObject, but the problem likely carries over elsewhere. Configuration: Not Applicable
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!