Bug 261485
| Summary: | `Expected` constructor with `unexpect` tag is broken | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Component: | Web Template Framework | Assignee: | Gerald Squelart <g_squelart> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | g_squelart, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Jean-Yves Avenard [:jya]
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)...)) { }`
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/115401559>
Gerald Squelart
Pull request: https://github.com/WebKit/WebKit/pull/17720
EWS
Committed 267931@main (95191e8f4045): <https://commits.webkit.org/267931@main>
Reviewed commits have been landed. Closing PR #17720 and removing active labels.