Afair this has been discussed with [guard self]
instead of autoweak
([Proposal] Guarded self in closures, Guarded closures).
It doesn't work with closures that return something, though: It might be possible to infer nil
if the result is optional... but still, that's no general solution.
I think it's very hard to come up with a really elegant solution, and next to impossible to avoid breaking compatibility (unless it can live alongside with the old behavior) - and even if all those concerns are addressed, the idea still has to survive the evolution process.