Moderately complex Swift enums cause EXC_BAD_ACCESS on iOS

Originator:devin.chalmers
Number:rdar://17757878 Date Originated:2014-07-21
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6 beta 4
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
When using an enum type that has more than one object typed case, on iOS, attempting to use some cases of the enum results in an EXC_BAD_ACCESS. The same enum type works fine in OSX, and the same enum with only one typed case works fine on iOS.

Reordering or otherwise changing the layout of the enum type doesn't seem to help.

Steps to Reproduce:
1. Open the attached Enums-iOS.playground
2. Open the assistant editor to see the console
3. Observe that execution of the file ends at line 25, and the console contains the results of an EXC_BAD_ACCESS error.
4. Open the attached Enums-OSX.playground.
5. Observe that execution continues through to the end.

Expected Results:
I would expect this code to run properly on both platforms.

Actual Results:
The iOS version of the enum crashes, both when running in a Playground and on devices running iOS 8 and iOS 7.

Version:
Xcode: 6.0 (6A267n)
Mac OS X: 10.9.4 (13E28)

Notes:


Configuration:
I am running Xcode 6 beta 4 on a mid-2011 iMac running OS X Mavericks v. 10.9.4.

Attachments:
'Enums-iOS.playground.zip' and 'Enums-OSX.playground.zip' were successfully uploaded.

(attachments as a gist here: https://gist.github.com/anonymous/ddded0394409658665fb)

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!