Bug 276665 - [Bindings] When generating a union of (callback, dict) we cannot convert from pointer-to-derived to pointer-to-base.
Summary: [Bindings] When generating a union of (callback, dict) we cannot convert from...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-07-16 10:21 PDT by Ryan Reno
Modified: 2024-08-04 22:12 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Reno 2024-07-16 10:21:15 PDT
IDL like this:

typedef (MyCallback, MyDict) MyUnion; 
interface MyInterface {
    undefined myFunction(optional MyUnion = {})
}

Will generate a function body for myFunction which will have as a conversion result for the argument an optional<variant<RefPtr<JSMyCallback>, MyDict>>. Which means that we *must* use a RefPtr to the derived JSWrapper class in WebCore rather than the base Wrapped class. This is because C++ won't let us convert from variant<Derived*, ...> to variant<Base*, ...> as they are distinct types.

There must be some way to either coax the C++ compiler to do what we mean or to modify the code generator to output the variant<Base*, ...> type as the result of the conversion.
Comment 1 Radar WebKit Bug Importer 2024-07-16 10:23:25 PDT
<rdar://problem/131851145>