swift compiler segfaults trying to generate a setter for a @lazy property in a subclass of NSObject

Originator:jgallagher
Number:rdar://17127126 Date Originated:6/3/2014
Status:Open Resolved:
Product:Xcode Product Version:6.0
Classification:Crash Reproducible:Always
 
Given a class:

class Foo: NSObject {
    @lazy var x = 1
}

This implementation in AppDelegate.swift:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
        var f = Foo()
        f.x = 2
        return true
    }

causes this error from the swift compiler:

1.	While emitting IR SIL function @_TFC13SwiftSegfault11AppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqCSo12NSDictionary__Sb for 'application' at /Users/john/Documents/swift/SwiftSegfault/SwiftSegfault/AppDelegate.swift:21:5
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254

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!