Xcode Version 6.0 (6A279r): [Swift] Extensions on generic types with additional generic constraints
| Originator: | janoschhildebrand | ||
| Number: | rdar://17709909 | Date Originated: | 17-Jul-2014 |
| Status: | Duplicate of 17144340 (Open) | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6.0 (6A279r) |
| Classification: | Feature Request | Reproducible: | NA |
Summary: When writing an extension to a generic class/struct/enum it would be useful to have the ability to specify additional generic constraints so that the extension would only apply to instances of the extended class that also conformed to the constraints specified in the extension. Take for example the Dictionary struct: struct Dictionary<KeyType : Hashable, ValueType> One might want to create an extension to Dictionary that only applied to instances for which the KeyType was a String and the ValueType conformed to a certain protocol. The functionality defined in the extension would then only be available in Dictionary instances that matched the extension's constraints. Steps to Reproduce: Expected Results: Actual Results: Version: Xcode 6 - Beta 3 (6A254o) Swift version 1.0 (swift-600.0.38.7) OS X 10.10 (14A283o)
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!