Appending to an array on a protocol marked as @objc crashes the Swift compiler

Originator:raphaelcruzeiro
Number:rdar://27803081 Date Originated:11-Aug-2016 12:08 PM
Status:Open Resolved:No
Product:Developer Tools Product Version:XCode 8 beta 6
Classification: Reproducible:Always
 
On a Swift 3 project, writing code that appends to an array on a protocol marked as @objc will cause the Swift compiler to segfault.

Steps to Reproduce:
1- Create a Swift 3 iOS project on XCode 8 beta 5
2 - Try to compile the following code:


import Foundation

@objc protocol Protocol: class {
    var numbers: [Int] { get set }
}

extension Protocol {

    func foo() {
        numbers.append(44)
    }
    
}

Expected Results:
Code to build flawlessly 

Actual Results:
Swift compiler segfaults

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!