Provide more ways to get associated value of associated value enum.

Originator:pitiphong.ph
Number:rdar://19518620 Date Originated:20-Jan-2015
Status:Opem Resolved:
Product:Swift Product Version:1.1
Classification:Enhancement Reproducible:Not Applicatble
 
Summary:
Now we cannot get the value of associated value enum in switch. I think it would be great that we can retrieve value from it in many more ways.

Steps to Reproduce:
Use this snippet in Playground

enum FileType {
  case File(ext: String)
}

let mp3 = FileType.File(ext: "mp3")
mp3.ext

Expected Results:
Can retrieve value of associated value. Playground displays "mp3"

Actual Results:
Compile error.

Version:
Swift 1.1/Xcode 6.1.1

Notes:
Now we already can declare the associated enum case value name (ext in case FileType(ext: String)) but can't retrieve it.
Also it would be great if we can retrieve it via .0, .1 etc. like tuple.

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!