Xcode 6.1 (6A1030): [Swift] Generic function where generic constraint is a protocol type crashes the compiler

Originator:janoschhildebrand
Number:rdar://18481432 Date Originated:28-Sep-2014
Status:Closed Resolved:Duplicate of 21341337
Product:Developer Tools Product Version:Xcode 6.1 (6A1030)
Classification:Serious Bug Reproducible:Always
 
Summary:
The following crashes the Swift compiler:

protocol Protocol {
}

func doSth<T : Protocol>(value: T?) {
    // ...
}

// Optional simply to avoid having to use an actual value
var action: Protocol?
doSth(action)


I've attached a sample project and a crash report.

Steps to Reproduce:
1) Open the attached Xcode project.
2) Build

Expected Results:
The code should compile successfully.

Actual Results:
The Swift compiler crashes.

Version:
Xcode 6.1 (6A1030)
Swift version 1.1 (swift-600.0.54.4)
OSX 10.9.5 (13F34)

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!