I haven't observed the need to explicitly state a return type in the examples I've seen, but we could certainly add this if we saw it become a problem in the wild. You should also be able to guide the type-checker's hand by writing withUnsafeContinuation { } as T to get it to pick up the return type from context.
I'll fix that, thanks.
resume(with:) came up as a result of our own experimentation with migrating some codebases to async that used Result. It's true that tying the error type of the Result to the error type of the continuation limits the usefulness of this API when the continuation has Error type; we have since added a further overload to help with this case:
extension UnsafeContinuation {
public func resume<Er: Error>(with result: Result<T, Er>) where E == Error
}
I'll update the proposal to include this.
This is the issue with including error parameters in these APIs in general; they're more for future proofing in case we add typed errors in the future, even if today you can only really use them with Never and Error. Since we've decided to also include error type parameters in other parts of the API, like Task.Handle and Task.Group, it seems worth it to be consistent here.