Hi everyone. The review of SE-0528, Non-Copyable Continuation, concluded on April 28, 2026. The Language Steering Group has decided the proposal should be accepted with modifications. In order to maintain naming consistency with related APIs in the standard library, the proposed withContinuation(of:throws:) top-level function shall be named withContinuation(of:throwing:).
The review discussion raised other questions about the proposed design, for which the language steering group accepts the proposed design as is:
- There was some concern that, as a non-
Copyabletype,Continuationwill be difficult to use due to various limitations and missing features of non-Copyabletypes today. Non-Copyabletypes are an area of active development, and the language steering group does not see any missing features as directly inhibiting the use ofContinuationtoday. Developers can continue to useCheckedContinuationwhereContinuationis too difficult to use, and the proposal provides a straightforward conversion for that purpose. - Reviewers aired concern that
Continuationwould benefit from the ability to specify types whose values must be explicitly consumed, which might be modeled similar to~Copyableby a suppressible~Discardableprotocol, and that by delivering the type today as only~Copyable, we would be foreclosing on the ability to take advantage of~Discardablein the future. However, the language steering group does not foresee us beginning work on such a feature anytime soon, and the ability of non-Copyabletypes to enforce uniqueness and single resumption is already a massive improvement in static safety over the existing continuation variants, that shouldn't need to wait an indeterminate amount of time for a slightly more ideal variant to become possible. If we did introduce~Discardableat some point in the future,~Discardabletypes would be subject to even stricter usage constraints that~Copyabletypes, and there would likely be a multi-year transition to catch the language and standard library up to them as we are currently undergoing with~Copyablenow. We can also pursue limited diagnostics that diagnose obvious misuse ofContinuationor other similar types that should not be allowed to implicitlydeinit; a limited diagnostic feature like that should be readily adoptable byContinuationas is. - In response to pitch feedback, the reviewed proposal removed captured source location information from the
Continuationtype, leaving its representation as only a single pointer to the suspended task. Reviewers asked whether this would lead to difficulties when debugging runtime crashes due to continuation misuse. The language steering group believes that keeping theContinuationtype lightweight is the correct tradeoff; sinceContinuationstatically enforces single ownership and resumption, the primary remaining source of runtime failure would be allowing aContinuationto bedeinit-ed without resuming. In that situation, the interesting context is most likely the place where the program crashed, rather than where the continuation was formed, since the crashing context should generally be the one that was responsible for either resuming the continuation or transferring ownership to someone else. From a debugger, the source of the continuation should also be readily available by looking for the suspended task and seeing what source location it is suspended at. - There was some debate as to whether allowing a
Continuationto bedeinit-ed should cause a runtime failure or only "leak" the continuation and let the program keep running (possibly with a warning logged to the console, asCheckedContinuationdoes today). The language steering group agrees with the proposal thatdeinitshould trigger a runtime failure. This should make it easier to catch mistakes during development, and in the future if Swift does gain new diagnostics or type system features for suppressing implicitdeinits, runtime failures also reduce the likelihood of "Hyrum's law" situations where existing code becomes dependent on leaked continuations for its expected behavior, which could become an impediment toContinuationadopting those features when they become available.
Thank you to everybody who participated in the review!