Open bialpio opened 4 years ago
Indeed, pretty certain that's exactly what I do; within a single spec you shouldn't be defining something both as a base and as a partial. ^_^
That said, I suspect the same problem would occur if a spec extended a dictionary defined elsewhere, and then used it.
Thanks for confirming! I've unblocked myself by moving the keys that I wanted to introduce in a partial definition up to the main definition. This might be more difficult to work around in multi-spec scenario though.
I'm also running in this issue. In a new spec, I'm defining a dictionary that has required members and then I have 3 dictionaries that inherit from it and that have no required members. Then, when I compile the spec I get:
FATAL ERROR: IDL ERROR LINE: 119 - Dictionary argument "init" without required members must be marked optional
When attempting to generate a spec from the below .bs file, bikeshed raises an error
FATAL ERROR: IDL ERROR LINE: 5 - Dictionary argument "init" without required members must be marked optional
. The error goes away either when the entirepartial dictionary FakeXRDeviceInit
gets uncommented, when makingFakeXRDeviceInit init
argument tosimulateDeviceConnection
method optional, or when adding some required key to thepartial dictionary FakeXRDeviceInit
. It seems that when validating method arguments, bikeshed only takes into account the latest occurrence of theFakeXRDeviceInit
dictionary & checks if it has any required keys, instead of looking at all the keys present in the definition (including the ones introduced by partial definitions).