[heycam/webidl] "Extended attributes associated with ..." omits UnionMemberType first alt? (#867)

The section describing annotated types provides [a set of rules](https://heycam.github.io/webidl/#idl-type-extended-attribute-associated-with) for determining which extended attributes are associated with a type (which is then the inner type of an annotated type). From a grammar POV, I think the cases it looks at are:

- Step 2: `TypeWithExtendedAttributes`
- Step 3: `TypeWithExtendedAttributes` again, but where `Type` is `UnionType Null`
- Step 4: `Argument`
- Step 5: `DictionaryMember`
- Step 6: `TypeWithExtendedAttributes` again, but via `TypeDef` reference

None of these cases appears to cover the first alternative of `UnionMemberType`:

- `ExtendedAttributeList DistinguishableType`

That is, the grammar allows for `([Attr] Type1 or Type2)` via that alternative, but I don’t think the “extended attributes associated with” set will actually end up including [Attr] for Type1 if these rules are followed as written. At a glance, it might look like step 3 touches on this case — but step 3 only seems to describe the propagation of the attr of `[Attr] (union here)` to each of the union’s members.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/867

Received on Sunday, 5 April 2020 07:23:36 UTC