whatwg / webidl

Web IDL Standard
https://webidl.spec.whatwg.org/
Other
405 stars 162 forks source link

ObservableArray is in DistinguishableType production but is not in distinguishable table #999

Open saschanaz opened 3 years ago

saschanaz commented 3 years ago

If it's intentionally not distinguishable, I think it shouldn't be in DistinguishableType.

EdgarChen commented 3 years ago

And per https://webidl.spec.whatwg.org/#idl-observable-array

Observable array types must only be used as the type of regular attributes defined on an interface

so it is disallowed to be an inner type of sequence, record, FrozenArray, and Promise.

If we could make ObservableArray not a DistinguishableType, but maybe a separate type just for regular attributes, we could handle the restriction in grammar level, which could make the parser implementation a bit simpler.

annevk commented 3 years ago

cc @domenic

domenic commented 3 years ago

I suspect people more grammar-comfortable, like @saschanaz or @EdgarChen, are better positioned to make this change than me. Would either of you be up for it? Happy to help review...

saschanaz commented 3 years ago

Maybe include it in SingleType instead? That will disallow it being in unions and I think it's expected.