Re: [heycam/webidl] Looking for some clarity on Promise<void> (#737)

The first piece of text seems to predate the introduction of <code>Promise&lt;<var>T</var>&gt;</code>. Technically `void` may indeed only appear in return types (as defined by the [_ReturnType_](https://heycam.github.io/webidl/#prod-ReturnType) production), but the _T_ in <code>Promise&lt;<var>T</var>&gt;</code> also matches _ReturnType_ per the grammar.

So yes, `Promise<void>` is permitted, not only as a return type of an operation but also of an attribute. (For example, a [`document.ready`](https://github.com/whatwg/html/issues/127) promise would probably be a `Promise<void>` if spec'd.) The first sentence should indeed be updated to account for promises. It should probably also be updated to account for things like callback function's return type, considering callback functions are not operations _per se_.

-- 
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/737#issuecomment-504708893

Received on Sunday, 23 June 2019 00:39:15 UTC