SE-0375: Opening existential arguments to optional parameters

Hello Swift community,

The review of SE-0375: Opening existential arguments to optional parameters begins now and runs through October 25th, 2022.

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 me as the review manager via PM on these forums. When messaging me directly, please put "[SE-0375]" at the start of the subject line.

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

Thanks for participating in this review.

Xiaodi Wu
Review Manager

17 Likes

LGTM, but as I mentioned in the pitch thread I would like to see a commitment to a dedicated diagnostic in the (any T)?-to-T? case. People tend to think of the “happy path” (non-nil argument), and it would probably save a lot of hours of frustration worldwide to just say “this can’t work because what if nil?”.

3 Likes

Looks great!

There’s a typo in the proposal: “ This can change the behavior of overload resulting”. I’m assuming that’s “overload resolution”.

This is an important extension to 5.7's existential opening proposal, and will allow more code that previously relied on existentials to be refactored as generic code instead, since currently one of the main reasons to stick with existentials is if a function takes an optional argument.

3 Likes

+1, obviously.

The language workgroup has decided to accept this proposal. Thanks.

1 Like