Bug 265118

Summary: NativePromise should allow void as reject type.
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: Web Template FrameworkAssignee: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Jean-Yves Avenard [:jya] 2023-11-19 19:03:56 PST
NativePromise::Result is using `Expected<T, U>` as storage type ; which doesn't allow to have U==void

And as such, NativePromise must set a non-void type a RejectValueType.

In bug 264028, you can now chain promises of different types together, and if you chain a void promise, that promise gets resolve whenever the original promise gets resolved, regardless of the resolve value.

It would be nice to do the same for rejection. And as such, we need for NativePromise to handle RejectValueType == void.

This can be achieved by using Expected<T, NativePromise::VoidPlaceholder>
Comment 1 Jean-Yves Avenard [:jya] 2023-11-20 03:06:33 PST
<rdar://problem/117782213>
Comment 2 Jean-Yves Avenard [:jya] 2023-11-20 03:07:09 PST
Pull request: https://github.com/WebKit/WebKit/pull/20738
Comment 3 Jean-Yves Avenard [:jya] 2023-11-20 03:20:16 PST
rdar://118645560
Comment 4 EWS 2023-11-20 18:04:47 PST
Committed 270995@main (bb71e93437b5): <https://commits.webkit.org/270995@main>

Reviewed commits have been landed. Closing PR #20738 and removing active labels.