`guard` capture specifier for closure capture lists

Thank you for the feedback, I really appreciate the transparency!

Would the core team consider permitting implicit self access in weak self closures once self has been unwrapped? Like in your example above:

{ [weak self] in
  guard let self = self else { return }

  // implicit use of non-optional self is allowed, since self has been unwrapped.
  // e.g. this is equivalent `self.dismiss()`:
  dismiss()
}

If that seems worth evaluating on its own, I can come back with an implementation / standalone proposal for that.

8 Likes