If a union has undefined
an initializer will remove null
or void
from the union as well.
#14406
Labels
Needs Investigation
This issue needs a team member to investigate its status.
TypeScript Version: locally with 2.2.1 and in playground
Code
with strictNullChecks option in playground
Expected behavior:
if undefined is specified explicitly by a union the initializer should not remove the void or null along with undefined.
I would expect VersionThree to behave like VersionTwo and VersionFour to be like VersionFive
Actual behavior:
adding undefined to the type union causes the resulting type to lose null or void.
The text was updated successfully, but these errors were encountered: