Swift: Defining protocols and typealiases with apparent circular dependencies causes a segfault
| Originator: | paulyoungonline | ||
| Number: | rdar://17986597 | Date Originated: | 12-Aug-2014 00:27 AM |
| Status: | Closed | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode6-Beta5 (6A279r) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: Defining a protocol with a typealias that must conform to another protocol that has a typealias that must conform to the original protocol causes a segfault. Steps to Reproduce: 1. Create a new Swift file 2. Define 2 protocols 3. Add a typealias to the first protocol that must conform to the second protocol 4. Add a typealias to the second protocol that must conform to the first protocol 5. Execute the file using `xcrun swift` or add it to a target in an Xcode project and attempt to build. Expected Results: The typealiases can be used in generics, like so: <T: FirstProtocol, U: SecondProtocol where T.FirstTypealias == SecondProtocol, U.SecondTypealias == T> Actual Results: Segmentation fault: 11 Version: Xcode6-Beta5 (6A279r) Attachments: 'SwiftProtocolTypealiasBug.swift' and 'SwiftProtocolTypealiasBug.png' were successfully uploaded.
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!
With Xcode 7.0 (7A220) I receive "error: type may not reference itself as a requirement" instead of "Segmentation fault: 11"