<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>275265</bug_id>
          
          <creation_ts>2024-06-07 12:27:05 -0700</creation_ts>
          <short_desc>Alias WTF::Expected against std::expected</short_desc>
          <delta_ts>2024-06-07 15:16:31 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=275190</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>263122</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Abrar Rahman Protyasha">a_protyasha</reporter>
          <assigned_to name="Abrar Rahman Protyasha">a_protyasha</assigned_to>
          <cc>a_protyasha</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2040362</commentid>
    <comment_count>0</comment_count>
    <who name="Abrar Rahman Protyasha">a_protyasha</who>
    <bug_when>2024-06-07 12:27:05 -0700</bug_when>
    <thetext>As a first step towards replacing `WTF::Expected` altogether.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2040363</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-06-07 12:27:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/129411820&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2040368</commentid>
    <comment_count>2</comment_count>
    <who name="Abrar Rahman Protyasha">a_protyasha</who>
    <bug_when>2024-06-07 12:32:38 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/29633</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2040421</commentid>
    <comment_count>3</comment_count>
    <who name="Abrar Rahman Protyasha">a_protyasha</who>
    <bug_when>2024-06-07 15:11:05 -0700</bug_when>
    <thetext>This is blocked by the fact that most of our types do not have non-throwing move constructors (or, they&apos;re not marked as such).

If either the result or the error type of `std::expected&lt;Result, Error&gt;` does not satisfy `std::is_nothrow_move_constructible_v`, then the copy assignment operator of that `std::expected` specialization is deleted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2040422</commentid>
    <comment_count>4</comment_count>
    <who name="Abrar Rahman Protyasha">a_protyasha</who>
    <bug_when>2024-06-07 15:13:02 -0700</bug_when>
    <thetext>Here&apos;s a representative error message:

```
In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource86.cpp:8:
/Users/aprotyas/dev/safari/OpenSource/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp:138:21: error: object of type &apos;ExceptionOr&lt;Ref&lt;Database&gt;&gt;&apos; cannot be assigned because its copy assignment operator is implicitly deleted
  138 |             backend = tryToOpenDatabaseBackend(document, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, RetryOpenDatabase);
In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource86.cpp:1:
In file included from /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp:27:
In file included from /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.h:31:
In file included from /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/dom/EventTarget.h:36:
/Users/aprotyas/dev/safari/OpenSource/Source/WebCore/dom/ExceptionOr.h:51:37: note: copy assignment operator of &apos;ExceptionOr&lt;WTF::Ref&lt;WebCore::Database&gt;&gt;&apos; is implicitly deleted because field &apos;m_value&apos; has a deleted copy assignment operator
   51 |     Expected&lt;ReturnType, Exception&gt; m_value;
In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource86.cpp:1:
In file included from /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/WebCorePrefix.h:165:
In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/HashMap.h:24:
In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/Forward.h:24:
In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/Expected.h:30:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.Internal.sdk/usr/include/c++/v1/expected:44:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.Internal.sdk/usr/include/c++/v1/__expected/expected.h:628:45: note: &apos;operator=&apos; has been explicitly marked deleted here
  628 |   _LIBCPP_HIDE_FROM_ABI constexpr expected&amp; operator=(const expected&amp;) = delete;
```</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>