[Webkit-unassigned] [Bug 262678] New: NativePromise can't take callbacks defined with `auto`

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 4 22:49:04 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=262678

            Bug ID: 262678
           Summary: NativePromise can't take callbacks defined with `auto`
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jean-yves.avenard at apple.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20231005/a5bccdf6/attachment.htm>


More information about the webkit-unassigned mailing list