Hello, Swift community.
The review of SE-0364: Warning for Retroactive Conformances of External Types ran from July 13th to 27th. The language workgroup accepted in principle that a warning should be added for such conformances, but returned the proposal for revision to explore what the mechanism of silencing the warning should be.
In particular, we wrote:
The proposed mechanism for silencing the warning is to fully-qualify both the type and protocol names in the conformance:
extension SomeModule.Type: SomeOtherModule.Protocol { ... }
This mechanism has the desirable quality that it does not require any new language features; this is a valid conformance in Swift 5.7, and would continue to be a valid conformance in the future. However, during the review period several commenters noted that they would prefer a more heavyweight indication that a conformance is retroactive. In returning for revision, we would like to consider the following alternative mechanism for silencing the warning:
extension Type: @retroactive Protocol { ... }
There are several considerations that might make this a desirable alternative:
- it is visual distinct, and easy to search for.
- there is existing support for
@unchecked Sendable
, so we are not blazing new syntactic or conceptual ground.- although all conformances are treated the same by the runtime at present, the information that a conformance is retroactive is available to the runtime. Thus, a future version might give retroactive conformances different semantics in casts in an attempt to resolve some of the issues that are raised in the thread for this proposal. In light of this, giving such conformances a visibly distinct (and searchable) source-level syntax may be appropriate.
Second Review
After some delay, the proposal has been returned for a second round of review, from today until May 9th. That review is limited to the new @retroactive
attribute.
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 contacting the review manager directly, please keep the proposal link at the top of the message and put "SE-0364" in 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
Thank you,
Steve Canon
Review Manager