Bug 262678
| Summary: | NativePromise can't take callbacks defined with `auto` | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Component: | Web Template Framework | Assignee: | 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 | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=262713 | ||
Jean-Yves Avenard [:jya]
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/116505009>
Jean-Yves Avenard [:jya]
Pull request: https://github.com/WebKit/WebKit/pull/18690
EWS
Committed 268913@main (93421fec4bd1): <https://commits.webkit.org/268913@main>
Reviewed commits have been landed. Closing PR #18690 and removing active labels.