Xcode-7-beta (7A120f): [Swift] Ability to constrain protocol conformance for structs

Originator:segiddins
Number:rdar://21435347 Date Originated:17-Jun-2015 08:59 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-7-beta (7A120f)
Classification:Feature (New) Reproducible:Always
 
Summary:
Let’s say I have a struct, Tree<T>. I’d like to declare Tree to be Equatable when T is Equatable.

Steps to Reproduce:
Try to compile the following code:
enum Tree<T> {}
extension Tree where T: Equatable {}

Expected Results:
The code should compile

Actual Results:
error: trailing 'where' clause for extension of non-protocol type 'Tree'

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!