Swift: Tuples should be allowed as keys for dictionaries

Originator:stephan.michels
Number:rdar://17340991 Date Originated:17-Jun-2014 01:39 PM
Status:Open Resolved:
Product:Developer Tools Product Version:10.10
Classification:Feature (New) Reproducible:Always
 
Often I need conglomerated keys in dictionaries. It would be helpful if it is possible to use tuples as keys.

dictionary[(.Enum1, 2)] = “Value 1”
dictionary[(.Enum2, 2)] = “Value 2”
 
println(dictionary[(.Enum1, 2)])

Currently it is not possible, because Tuples doesn’t implement Hashable.

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!