Xcode6-Beta3: Cannot subclass or extend classes from same module in Swift
Originator: | jp | ||
Number: | rdar://17601747 | Date Originated: | 8/7/2014 |
Status: | Closed | Resolved: | March 1 2015 |
Product: | Developer Tools | Product Version: | Version 6.0 (6A254o) |
Classification: | Reproducible: | Always |
In a mixed Objective-C/Swift framework, I can't subclass or extend Objective-C classes defined in the framework from Swift. Ex.: ```swift class MySubclass: ClassDefinedInObjC {} // Fails: Attempting to use the forward class 'ClassDefinedInObjC' as superclass of 'MySubclass' extension ClassDefinedInObjC {} // Fails: Cannot define category for undefined class 'ClassDefinedInObjC' func useObjCClass() { ClassDefinedInObjC().methodOnClass() // Succeeds } ``` This worked fine with Xcode6-Beta and Xcode6-Beta2, but doesn't work in Xcode6-Beta3. Steps to Reproduce: 1. Create a framework in Xcode6-Beta3 containing Objective-C and Swift code 2. Create a subclass of a class defined in the Objective-C code from Swift. Expected Results: The framework compiles. Actual Results: The framework doesn't compile. Error message varies but can display: - Attempting to use the forward class 'ClassDefinedInObjC' as superclass of 'MySubclass' - Cannot define category for undefined class 'ClassDefinedInObjC'
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!
This has been fixed.