webidl generates bad operator== for dictionaries that inherit from other dictionaries
Categories
(Core :: DOM: Bindings (WebIDL), task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox128 | --- | fixed |
People
(Reporter: bwc, Assigned: peterv)
Details
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
330.76 KB,
patch
|
Details | Diff | Splinter Review |
Sometimes no operator== is generated at all:
Sometimes operator== does not take into account the fields in the base class, even when the base class has an operator==:
which is a subclass of
which is a subclass of
| Reporter | ||
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
We only generate a operator== for dictionaries containing strings or primitive types (see https://searchfox.org/mozilla-central/rev/ee2ad260c25310a9fbf96031de05bbc0e94394cc/dom/bindings/Codegen.py#17694-17697 and https://bugzilla.mozilla.org/show_bug.cgi?id=1249606#c1). Seems like this needs some fixes for inherited dictionaries.
| Assignee | ||
Comment 3•2 years ago
|
||
This also extends the check for supported types to the types of inherited
members, and automatically generates an equality operator in the base classes if
needed. It also deletes the equality operator if a dictionary doesn't need
one but its parent does.
Updated•2 years ago
|
| Assignee | ||
Comment 4•2 years ago
|
||
| Assignee | ||
Comment 5•2 years ago
|
||
Byron, do you actually need these operator==s? The patch removes them, but we can add them back with the new [GenerateEqualityOperator] if needed.
| Reporter | ||
Comment 6•2 years ago
|
||
I don't know that we are currently using them anywhere. Having operator== that covers all of the fields would be useful to us, but I can try that out in a separate bug.
Updated•2 years ago
|
Description
•