Swift enums should allow default associated values

Originator:paulyoungonline
Number:rdar://22871341 Date Originated:26-Sep-2015 05:34 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Version 7.0 (7A220)
Classification:Enhancement Reproducible:Always
 
Summary:
Like function parameters, it would be useful to be able to provide defaults for associated values in enums.

This would allow parameters with defaults to be omitted when passing those cases.

Steps to Reproduce:
1. Open EnumDefaultAssociatedValues.playground

Expected Results:
No compiler error is shown.

Actual Results:
A compiler error "Default argument not permitted in tuple type" is shown.

Version:
Version 7.0 (7A220)

Attachments:
'EnumDefaultAssociatedValues.playground.zip' was successfully uploaded.

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!