Swift: Calling nested generic functions from nested sibling functions crashes the compiler
| Originator: | rix.rob | ||
| Number: | rdar://19097334 | Date Originated: | 30-Nov-2014 03:06 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6.1.1 (6A2006) |
| Classification: | Crash/Hang/Data Loss | Reproducible: | Always |
Summary:
A generic function nested within an outer function called from a sibling function crashes.
This seemed really familiar, but it isn’t in the release notes for Xcode 6.2 and I don’t have the ones for 6.1.1 handy. (It crashes with Xcode 6.2’s swift anyway.)
Steps to Reproduce:
1. Compile this code:
func f() {
func g<T>(h: T -> ()) -> () {
return ()
}
func i() {
g { (x: Int) in () }
}
}
Expected Results:
Not crash.
Actual Results:
Crash.
Regression:
Moving g() up out of f() resolves the crash.
Seems to depend on g being generic.
Notes:
Crash log attached.
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!