[Webkit-unassigned] [Bug 261485] New: `Expected` constructor with `unexpect` tag is broken

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 12 16:54:35 PDT 2023


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

            Bug ID: 261485
           Summary: `Expected` constructor with `unexpect` tag is broken
           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

Trying to construct an `Expected<int, double>` using `Expected(unexpect, 32.0)` gave me a compilation error 
"No viable conversion from 'std::experimental::unexpected<double>' to 'value_type' (aka 'int')"

The code is wrong 
https://searchfox.org/wubkat/rev/b38121da42a0483fdb1bc13782f1c7a8059de100/Source/WTF/wtf/Expected.h#448

`template<class... Args> constexpr explicit expected(unexpected_t, Args&&... args) : base(__expected_detail::value_tag, unexpected_type(std::forward<Args>(args)...)) { }`
should be:

`template<class... Args> constexpr explicit expected(unexpected_t, Args&&... args) : base(__expected_detail::error_tag, unexpected_type(std::forward<Args>(args)...)) { }`

-- 
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/20230912/fe43f647/attachment.htm>


More information about the webkit-unassigned mailing list