Closed
Description
Previous ID | SR-184 |
Radar | None |
Original Reporter | @jckarter |
Type | Bug |
Status | Resolved |
Resolution | Done |
Additional Detail from JIRA
Votes | 0 |
Component/s | |
Labels | Bug |
Assignee | @gregomni |
Priority | Medium |
md5: baeea16bd3d67c1a509c4f3789ecf120
Issue Description:
The following code complains that x is used by a closure before being initialized, instead of more accurately complaining that it's optional-chained (or just generically that it's used):
let x: String?
if [1,2,3].contains(2) {
x = "lala"
}
// else {
// x = nil
// }
print(x)
print(x?.characters.count)