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.
<rdar://problem/131851145>