SE-0418: Inferring Sendable for methods and key path literals

Hello Swift community,

The review of "Inferring Sendable for methods and key path literals" begins now and runs through January 1, 2024. The proposal is available here:

https://github.com/apple/swift-evolution/blob/main/proposals/0418-inferring-sendable-for-methods.md

Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to the review manager by email. When emailing the review manager directly, please include "SE-0418" in the subject line.

Trying it out

If you'd like to try this proposal out, you can download a toolchain supporting it here. Any trunk development snapshot dated in December 2023 should do. You will need to add -enable-experimental-feature InferSendableFromCaptures to your build flags.

(Edit: Note that the proposed changes to the appending(path:) methods are not in the toolchain.)

What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:

  • What is your evaluation of the proposal?
  • Is the problem being addressed significant enough to warrant a change to Swift?
  • Does this proposal fit well with the feel and direction of Swift?
  • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
  • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

More information about the Swift evolution process is available at

https://github.com/apple/swift-evolution/blob/main/process.md

Happy reviewing,

—Becca Royal-Gordon
SE-0418 Review Manager

15 Likes

I am a bit confused by the Extending key path merging functionality to preserve sendability section. It's listed under Detailed design but the discussion under that heading is worded in the hypothetical (what 'could' or 'would' happen) as though it was part of Future directions. Are the bits in that subsection being proposed or not?

Those changes are within the scope of this proposal, yes. (But I don’t know if they’re in the toolchain, come to think of it—@xedin?)

The changes are not in the toolchain, we'd need some more feedback from standard library folks before implementing it. cc @Joe_Groff

This proposal interacts strongly with SE-0416, but I don't see details of that interaction in either this proposal or that one.

It only interacts in a way listed in Proposed Solution section where it allows to reserve sendability of the functions and key paths through the conversion, all other existing and newly proposal rules are unaffected by this.

3 Likes

Thank you all for participating in the review. The language steering group has accepted the proposal; please see the announcement for more details.