SourceKitService crashes when using variable of type AnyObject!

Originator:stefan.vandenoord
Number:rdar://18594160 Date Originated:2014-10-09
Status: Resolved:
Product:Developer Tools Product Version:
Classification:Crash Reproducible:Always
 
Summary:
Please refer to the attached project where the issue can easily be reproduced. In the test target, there is a file 'SwiftCrashAnyObjectTests.swift'. When line 20 of that file is un-commented, SourceKitService crashes. One of the crash logs is also attached to this issue.

Steps to Reproduce:
1. Install Xcode 6 (I'm using 6.0.1)
2. Extract the attached zip file to a convenient location
2. Open the project in the extracted zip file in Xcode
3. In Xcode, open the file SwiftCrashAnyObjectTests.swift
4. Verify that syntax highlighting works normally and no crash occurs
5. Still in Xcode, remove the two forward slashes at the beginning of line 20 of that file


Expected Results:
Xcode should keep working normally, and syntax highlighting should keep working.

Actual Results:
Xcode reports that SourceKitService has crashed and generates a crash log file (see attached example). Syntax highlighting doesn't work anymore.

Version:
OS X 10.9.5 (13F34)
Xcode 6.0.1 (6A317)


Notes:


Configuration:
Always occurs on my machine.

Attachments:
'SwiftCrashAnyObject.zip' and 'SourceKitService_2014-10-09-102604_StelmaBook.crash' were successfully uploaded.

Note for openradar: The file that is referred to, contains the following code:

class SwiftCrashAnyObjectTests: XCTestCase {
    
    var a:AnyObject?
    var b:AnyObject!
    
    func testB()
    {
        println(a!["test"])
//        println(b["test"]) //<-- this line
    }
    
}

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!