Skip to content

The second interface in an IDL block causes the required-dict check to misfire on derived dicts #88

@tabatkins

Description

@tabatkins

Yes, the title is weirdly specific, because the error is.

Take the following IDL snippet:

interface NeededForSomeReason {
};

interface Foo {
  undefined usesBase(BaseDict options);
  undefined usesDerived(DerivedDict options);
};

dictionary BaseDict {
  required DOMString req;
};

dictionary DerivedDict : BaseDict {
  DOMString opt;
};

This should be valid - both BaseDict and DerivedDict contain required members, so their use as method arguments without a default is valid. However, widlparser reports that the usesDerived() method's argument needs to be optional due to lacking required members.

The weird thing is this only happens if the interface triggering the error is the second in the block. If you remove the first interface, or swap the order of the two interfaces, there's no error.

(Reported in speced/bikeshed#3023 originally.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions