Xcode 6.3: Swift type overrides module of same name
| Originator: | natecook | ||
| Number: | rdar://20633559 | Date Originated: | 21-Apr-2015 11:35 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6.3 (6D570) |
| Classification: | Crash/Hang/Data Loss | Reproducible: | Always |
When importing a module that contains a type with the same name as the framework, it’s impossible to use the module name to select a shadowed type within the module via namespacing. The attached project shows this in action: it defines a framework titled “NameConflictTest” that declares two types: “NameConflictTest” and “A”. The included playground imports the “NameConflictTest” module and creates an instance of the type with the same name. It then declares a new type with the name “A” that overrides the imported “A” type. There is no longer any way to reference the imported “A” type. To reproduce: 1. Open the attached project, NameConflictTest 2. Open the included Playground as part of the project 3. Uncomment the last line It should create a new instance of type A, as declared within the NameConflictTest framework Instead, it gives an error: ‘NameConflictTest.Type’ does not have a member named ‘A’.
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!