Re: [heycam/webidl] Type association restrictions for extended attributes break with unions (#827)

Hmm.  That would be one option.  The other would be to:

1) Define a concept of "type A that may be type B" which would then be defined to do sane things for unions and nullables.
2) Allow `[AllowShared]` on any type that may be a buffer source type.

That's equivalent to the proposal in https://github.com/heycam/webidl/issues/827#issuecomment-565102739 as far as observable behavior for `[AllowShared] ArrayBufferView` and also allows `[AllowShared] ArrayBufferView?`, though we would need some changes to https://heycam.github.io/webidl/#idl-type-extended-attribute-associated-with to propagate through nullables.  It seems like we should do that, since fundamentally `?` is pretty much like a union type but with different syntax...

If we wanted to also allow `[AllowShared] (ArrayBuffer or DOMString)` we could fix union propagation to only propagate if the extended attr applies to the inner type, right?  I don't really see a reason to forbid it...

-- 
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/827#issuecomment-565115027

Received on Thursday, 12 December 2019 17:55:06 UTC