someFunction(completion: { [weak self] in
self?.variable = self!.otherVariable
})
Is this always safe? I access the optional <
The documentation clearly states that, if the left side of the assignment is determined to be nil, right side will not be evaluated.
However, in the given example self is weak reference and may be released (and nullified) right after the optional check passes, but just before force-unwrap will happen, making the whole expression nil-unsafe.