Swift: Tuples and structs are almost but not quite entirely the same thing

Originator:rix.rob
Number:rdar://17515296 Date Originated:30-Jun-2014 09:46 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode6-Beta2 (6A216f)
Classification:Serious Bug Reproducible:Always
 
Summary:
Tuples and structs are very very close to being the same thing. The language would be better if they were literally the same thing.

Tuples:
- can be instantiated anonymously
- can be pattern matched against

Structs:
- can be defined type-parametrically
- can have functions defined on them
- can conform to protocols
- can be extended

Put these together and you have a much more compelling feature than either is on its own. Therefore, I would like tuples to be anonymous structs and for all structs to have pattern matching.


Steps to Reproduce:
N/A


Expected Results:
N/A


Actual Results:
N/A


Regression:
N/A


Notes:
N/A

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!