Swift does not allow a type to be extended with a LiteralConvertible protocol
| Originator: | larcus94 | ||
| Number: | rdar://21426865 | Date Originated: | 6-17 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode Version 7.0 beta (7A120f) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: Swift makes it impossible to extend any type with a LiteralConvertible protocol like IntegerLiteralConvertible. The problem is that the protocol needs a required initializer, which is not allowed in an extension. Steps to Reproduce: 1. Extend UIColor with the IntegerLiteralConvertible protocol 2. Implement the initializer 3. Try compile it Expected Results: It compiles and integers can be used in place of UIColor instances. Actual Results: The project does not compile. Version: Xcode Version 7.0 beta (7A120f) OSX Yosemite Version 10.10.3 (14D136)
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!