Crash when copying struct with @class_protocol ref

Originator:nategriswold
Number:rdar://17243223 Date Originated:6/9/2014
Status:open Resolved:
Product:iOS Product Version:8.0 beta1
Classification:crash Reproducible:always
 
@class_protocol protocol Proto {
    func protofunc()
}

class Impl : Proto {
    var abc : Int?
    
    func protofunc() {}
}

struct StructWithRef {
    weak var proto : Proto?
}

func testCrash() {
    var impl = Impl()
    var structWithRef = StructWithRef(proto: impl)
    var array = StructWithRef[]()
    array.append(structWithRef)
}

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!