Closed as not planned
Description
Previous ID | SR-815 |
Radar | rdar://problem/25318716 |
Original Reporter | wiruzx (JIRA User) |
Type | Bug |
Environment
Swift 2.1.1, iOS 7
Swift 2.2, iOS 9.3
Additional Detail from JIRA
Votes | 22 |
Component/s | Compiler |
Labels | Bug, RunTimeCrash |
Assignee | None |
Priority | Medium |
md5: ab6cd5d5f6905bbd52b11768623b6abf
is duplicated by:
- SR-1659 Swift2.2.1 generics property crash
relates to:
- SR-1201 All generic class crash on iOS 7
Issue Description:
class Test<T> {
let object = NSObject()
var value: T?
func test() {
print(object) // EXC_BAD_ACCESS here
}
}
let x = Test<Int>()
x.test()
It doesn't matter if object will be NSObject or Swift's ref type.
Bug is not being reproduced if you either:
-
make class non-generic,
-
remove `value` property,
-
swap `object` and `value` properties declarations,
-
initialize object in `init`
This issue reproduces only on iOS 7