Swift: Crash when trying to use for/in with NSEnumerator

Originator:rix.rob
Number:rdar://17441998 Date Originated:24-Jun-2014 05:50 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode6-Beta2 (6A216f)
Classification:Serious Bug Reproducible:Always
 
Summary:
Using Swift’s for/in syntax with an NSEnumerator crashes the compiler (and SourceKitService).

Steps to Reproduce:
1. Try to compile this code:

let enumerator = NSArray(array: [ "one", "two", "three" ]).objectEnumerator()
for each in enumerator {}


Expected Results:
I expected it to compile, or to give me an error explaining why it can’t.


Actual Results:
It crashed.


Regression:
N/A


Notes:
This doesn’t occur when using for/in with an NSArray, so I have to assume that the problem is with NSEnumerator and not e.g. NSFastEnumeration.

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!