Hello, Swift Evolution!
The review of SE-0520: Discardable result use in Task initializers concluded, and the Language Steering Group decided that the proposal is accepted.
The review discussion was positive, and the constructive discussion focused on more cases where we should consider producing warnings on discarded task handles:
- Some reviewers argued that ignoring task handles should always produce a warning. The LSG believes this would be an overly pervasive warning; fire-and-forget tasks are a common and intentional pattern, and requiring
_ =in these cases would add noise without meaningful benefit. - Some reviewers suggested that discarded task handles should produce warnings when the task produces a result. The LSG agrees that improving diagnostics around discarded task results is worth pursuing, but considers this a separate problem from unhandled errors in tasks. Addressing it properly, particularly in cases involving propagation of
@discardableResultthrough closure results, will require a dedicated design discussion.
Thank you to everyone who participated in the pitch and proposal review. Your contributions help make Swift a better language.
Holly Borla
Review Manager