[heycam/webidl] NonAnyType vs SingleType as home of PromiseType ε alternative (#740)

- The `NonAnyType` production is only used within [`UnionMemberType`][1] and [`SingleType`][2].
- `NonAnyType` [includes the alternative `PromiseType ε`][3].
- A Union type comprises [‘two or more other types’][4].
- Promise types are [not distinguishable from any other type][5].
- [Each pair of flattened member types in a union type, T and U, must be distinguishable.][6]

I may be missing or misunderstanding something (perhaps in the last item?), but it seems like, if all of the above statements are true, that a Promise type is never a valid union member. If that’s true, then the `PromiseType ε` alternative should probably be moved from `NonAnyType` to `SingleType` so that this constraint gets enforced syntactically.

[1]: https://heycam.github.io/webidl/#prod-UnionMemberType

[2]: https://heycam.github.io/webidl/#index-prod-SingleType

[3]: https://heycam.github.io/webidl/#prod-NonAnyType

[4]: https://heycam.github.io/webidl/#dfn-union-type

[5]: https://heycam.github.io/webidl/#example-distinguishability-promises

[6]: https://heycam.github.io/webidl/#ref-for-dfn-flattened-union-member-types%E2%91%A8


-- 
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/740

Received on Monday, 24 June 2019 08:54:58 UTC