Bug 276665

Summary: [Bindings] When generating a union of (callback, dict) we cannot convert from pointer-to-derived to pointer-to-base.
Product: WebKit Reporter: Ryan Reno <rreno>
Component: BindingsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: cdumez, kiet.ho, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Ryan Reno
Reported 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.
Attachments
Radar WebKit Bug Importer
Comment 1 2024-07-16 10:23:25 PDT
Note You need to log in before you can comment on or make changes to this bug.