swift
swift copied to clipboard
[SR-2360] Extensions to Objective-C Generic Types Don't Work At All
| Previous ID | SR-2360 |
| Radar | None |
| Original Reporter | @jadengeller |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Attachment: Download
Environment
Xcode 8 Beta 6, Swift 3
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Bug, CompilerCrash |
| Assignee | @jadengeller |
| Priority | Medium |
md5: 0faf0d47f15e9363fc82de8efd295861
Issue Description:
I cannot write a single extension to this type that won't cause a compiler crash.
@interface Box<T> : NSObject
@property (nonatomic) T value;
@end
/* Segfaults the compiler */
//extension Box {
// func test(_ value: T) -> Int {
// return 0
// }
//}
/* Segfaults the compiler */
//extension Box {
// func test(_ value: Any) -> Int {
// return 0
// }
//}
/* Segfaults the compiler */
//extension Box {
// func test(_ value: AnyObject) -> Int {
// return 0
// }
//}
/* Segfaults the compiler */
//extension Box {
// func test(_ value: AnyObject) {
// }
//}
/* Segfaults the compiler */
//extension Box {
// func test(_ value: Int) {
// }
//}
/* Segfaults the compiler */
//extension Box {
// func test() {
// }
//}
@slavapestov, @jckarter, another for the pile.
These all work in master. There was a bug with debug info in ObjC generic extension contexts; you can try turning off debug info as a workaround until a new snapshot comes out.