[heycam/webidl] undefined can't be a member of a union type (#962)

I think one of the goals of #60 was to allow union types with undefined as a member type for return values. It did so by just adding undefined to the grammar for Type. Union types currently require member types to be distinguishable (_Each pair of flattened member types in a union type, T and U, must be distinguishable_). I don't see any changes to that in #906, or any changes to add rules for undefined in the distinguishability algorithm, so right now undefined cannot actually be a member type of a union type.

The prose for union type conversion to an ECMAScript value also still contains the following sentence: _If the value is an object reference to a special object that represents an ECMAScript undefined value, then it is converted to the ECMAScript undefined value_. I'm not sure we should keep that, there is a [rule](https://heycam.github.io/webidl/#es-undefined) for conversion of the undefined type, so it should be possible to rely on the generic algorithm there.

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

Received on Tuesday, 9 March 2021 10:47:55 UTC