RESOLVED FIXED 262678
NativePromise can't take callbacks defined with `auto`
https://bugs.webkit.org/show_bug.cgi?id=262678
Summary NativePromise can't take callbacks defined with `auto`
Jean-Yves Avenard [:jya]
Reported 2023-10-04 22:49:04 PDT
NativePromise template's to determine the type traits of the resolve/reject/settle methods are unable to deal with a lambda using `auto` for the type. It causes a rather confusing, very long error message. so you can't write something like: using MyPromise = NativePromise<int, String>; MyPromise::createAndSettle(workqueue, [] (auto&& result) { }); you need to write: MyPromise::createAndSettle(workqueue, [] (MyPromise::Result&& result) { }); While it could be argued the latter is more readable and less prone to confusion, using `auto` everywhere is a rather popular trend within the WebKit team. So we should be able to deal with that if possible.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-10-04 22:49:22 PDT
Jean-Yves Avenard [:jya]
Comment 2 2023-10-05 05:45:37 PDT
EWS
Comment 3 2023-10-05 07:22:50 PDT
Committed 268913@main (93421fec4bd1): <https://commits.webkit.org/268913@main> Reviewed commits have been landed. Closing PR #18690 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.