Allow the combination of classes/structs and protocols in a type declaration
Originator: | tom | ||
Number: | rdar://20990743 | Date Originated: | 17-May-2015 10:42 AM |
Status: | Duplicate (15873071 - Open) | Resolved: | |
Product: | Developer Tools | Product Version: | Swift 1.2 |
Classification: | Feature (New) | Reproducible: | Always |
Summary: Right now, in Objective-C this is possible: SomeClass<SomeProtocol> *variable; However, you cannot express the same "type" in Swift. You can do something similar with generic parameters: <T: SomeClass where T: SomeProtocol> but constraints like these aren't representable as a type yet. Steps to Reproduce: See code above. Expected Results: Code compiles. Actual Results: Code doesn't compile, syntax does not exist yet. Notes: In reference, a tweet from Joe Groff: https://twitter.com/jckarter/status/598148395933372416 in a discussion about this.
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!